This shows you the differences between two versions of the page.
|
pm:prj2022:dbrezeanu:spanzuratoarea [2022/06/06 04:31] andrei.alexa |
pm:prj2022:dbrezeanu:spanzuratoarea [2022/06/06 11:19] (current) andrei.alexa |
||
|---|---|---|---|
| Line 29: | Line 29: | ||
| <note tip> | <note tip> | ||
| IDE folosit : [[https://www.arduino.cc/en/software|Arduino IDE 1.8.19]] | IDE folosit : [[https://www.arduino.cc/en/software|Arduino IDE 1.8.19]] | ||
| - | Cod rulat pentru resetarea placi : | + | |
| - | <hidden>void setup() { | + | Cod rulat pentru resetarea placi: |
| + | <note>void setup() { | ||
| // put your setup code here, to run once: | // put your setup code here, to run once: | ||
| Line 38: | Line 39: | ||
| // put your main code here, to run repeatedly: | // put your main code here, to run repeatedly: | ||
| - | }</hidden> | + | }</note> |
| + | Variabila cu lista de cuvinte de unde alegem un cuvant random din lista: | ||
| + | <note>const char* words[] = {"politehnica", "dorna", "fils", "ventilator", "pahar", "punga", "paste", "examen", "deodorant", "elefant"}; | ||
| + | |||
| + | void newWord() { | ||
| + | |||
| + | int pick = random(NUMWORDS); | ||
| + | const char* pickWord = words[pick]; | ||
| + | guessWord = pickWord; | ||
| + | wordSize = guessWord.length(); | ||
| + | }</note> | ||
| + | Conditiile pentru a castiga/pierde sau a reseta jocul: | ||
| + | <note>void gameOver(int whatToDo) { | ||
| + | |||
| + | |||
| + | switch (whatToDo) { | ||
| + | case 0: | ||
| + | lcd.clear(); | ||
| + | lcd.setCursor(6, 0); | ||
| + | lcd.print("AI"); | ||
| + | lcd.setCursor(6, 1); | ||
| + | lcd.print("PIERDUT"); | ||
| + | |||
| + | |||
| + | break; | ||
| + | case 1: | ||
| + | lcd.clear(); | ||
| + | lcd.setCursor(4, 0); | ||
| + | lcd.print("AI"); | ||
| + | lcd.setCursor(4, 1); | ||
| + | lcd.print("CASTIGAT"); | ||
| + | |||
| + | |||
| + | } | ||
| + | delay(2000); | ||
| + | resetFunc(); | ||
| + | } | ||
| + | </note> | ||
| </note> | </note> | ||
| Line 44: | Line 82: | ||
| {{:pm:prj2022:dbrezeanu:andreialexaresult.jpg?400|}} | {{:pm:prj2022:dbrezeanu:andreialexaresult.jpg?400|}} | ||
| <note tip> | <note tip> | ||
| - | Filmare : *coming soon* | + | Filmare : {{:pm:prj2022:dbrezeanu:andreialexaspanzuratoarea.rar|}} |
| </note> | </note> | ||