Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
lehrkraefte:blc:informatik:glf20:oxotetris [2020/12/14 11:14] Ivo Blöchliger created |
lehrkraefte:blc:informatik:glf20:oxotetris [2020/12/17 14:02] (current) Ivo Blöchliger [Highscores auf dem Web] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Tetris auf der OxoCard ====== | ====== Tetris auf der OxoCard ====== | ||
+ | |||
+ | Erläuterungen zum Code gibt es als Videos: | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
<code python oxotetris.py> | <code python oxotetris.py> | ||
Line 11: | Line 17: | ||
# Gamestate als Dictionary, d.h. wie eine Liste aber mit Namen als Indizes | # Gamestate als Dictionary, d.h. wie eine Liste aber mit Namen als Indizes | ||
tetris = { | tetris = { | ||
- | " | + | " |
" | " | ||
" | " | ||
Line 98: | Line 104: | ||
f = BLACK | f = BLACK | ||
if yyy>0: | if yyy>0: | ||
- | f = fastGetDot(x, | ||
tetris[' | tetris[' | ||
else: | else: | ||
tetris[' | tetris[' | ||
if tetris[' | if tetris[' | ||
- | fastDot(x, | + | fastDot(x, |
else: | else: | ||
black(x, | black(x, | ||
Line 137: | Line 142: | ||
for pt in tetris[' | for pt in tetris[' | ||
if (pt[1]+tetris[' | if (pt[1]+tetris[' | ||
- | tetris[' | + | tetris[' |
checkLines() | checkLines() | ||
return not neuerStein() | return not neuerStein() | ||
Line 197: | Line 202: | ||
while True: | while True: | ||
bigTextScroll((" | bigTextScroll((" | ||
- | |||
</ | </ | ||
+ | |||
+ | ===== Highscores auf dem Web ===== | ||
+ | Was folgt sind Notizen, um von der OxoCard die Highscores auf dem Web zu publizieren. | ||
+ | <code python> | ||
+ | from tcpcom import * | ||
+ | # See dcoumentation directly in the code of the OxoCard modules files | ||
+ | Wlan.connect(" | ||
+ | client = HTTPClient() | ||
+ | client._isSSL=True | ||
+ | if client.connect(" | ||
+ | response = client.sendPostRequest("/ | ||
+ | print(response) | ||
+ | client.closeConnection() | ||
+ | |||
+ | </ |