Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
| gf_informatik:microbit_und_roboter_programmieren:repetitionsaufgaben [2023-10-03 20:26] – [Aufgaben RC] gra | gf_informatik:microbit_und_roboter_programmieren:repetitionsaufgaben [2023-10-04 14:29] (aktuell) – [Aufgaben RD] gra | ||
|---|---|---|---|
| Zeile 124: | Zeile 124: | ||
| === Aufgaben RA === | === Aufgaben RA === | ||
| - | < | + | < |
| ++++ RA1:| | ++++ RA1:| | ||
| <code python> | <code python> | ||
| Zeile 217: | Zeile 217: | ||
| </ | </ | ||
| === Aufgaben RB === | === Aufgaben RB === | ||
| - | < | + | < |
| ++++ RB1:| | ++++ RB1:| | ||
| <code python> | <code python> | ||
| Zeile 304: | Zeile 304: | ||
| </ | </ | ||
| === Aufgaben RC === | === Aufgaben RC === | ||
| - | < | + | < |
| ++++ RC1:| | ++++ RC1:| | ||
| <code python> | <code python> | ||
| Zeile 392: | Zeile 392: | ||
| </ | </ | ||
| === Aufgaben RD === | === Aufgaben RD === | ||
| + | <nodisp 1> | ||
| + | ++++ RD1:| | ||
| + | <code python> | ||
| + | from microbit import * | ||
| + | import random | ||
| + | |||
| + | index = 0 | ||
| + | while True: | ||
| + | if button_a.was_pressed(): | ||
| + | index = (index + 1) % 12 | ||
| + | display.show(Image.ALL_CLOCKS[index]) | ||
| + | </ | ||
| + | ++++ | ||
| + | |||
| + | ++++ RD2:| | ||
| + | <code python> | ||
| + | from microbit import * | ||
| + | import random | ||
| + | |||
| + | subjekte = [" | ||
| + | verben = [" | ||
| + | adjektive = [" | ||
| + | objekte = [" | ||
| + | |||
| + | index = 0 | ||
| + | while True: | ||
| + | if button_a.was_pressed(): | ||
| + | subjekt = random.choice(subjekte) | ||
| + | verb = random.choice(verben) | ||
| + | adjektiv = random.choice(adjektive) | ||
| + | objekt = random.choice(objekte) | ||
| + | satz = "{} {} {} {}." | ||
| + | print(satz) | ||
| + | </ | ||
| + | ++++ | ||
| + | |||
| + | ++++ RD3:| | ||
| + | <code python> | ||
| + | from microbit import * | ||
| + | |||
| + | buchstaben = [" | ||
| + | |||
| + | index = 0 | ||
| + | wort = '' | ||
| + | while True: | ||
| + | display.show(buchstaben[index]) | ||
| + | if button_a.was_pressed(): | ||
| + | index = (index + 1) % 26 | ||
| + | if button_b.was_pressed(): | ||
| + | wort = wort + buchstaben[index] | ||
| + | if pin_logo.is_touched(): | ||
| + | print(wort) | ||
| + | sleep(100) | ||
| + | wort = '' | ||
| + | </ | ||
| + | ++++ | ||
| + | |||
| + | |||
| + | </ | ||