Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
game.cpp
00001 #include "game.h" 00002 #include "list.h" 00003 00004 void score(Apple* apple, int* points) { 00005 *points += 10; 00006 apple->row = rand() % ROW; 00007 apple->col = rand() % COL; 00008 } 00009 00010 int checkGameOver(List* snake) { 00011 Lnode* head = snake->head; 00012 Lnode* phere = head->next; 00013 while(phere != NULL) { 00014 if(phere->row == head->row && phere->col == head->col) { 00015 return 0; 00016 } 00017 phere = phere->next; 00018 } 00019 if(head->row < 0 || head->row > ROW || head-> col < 0 || head->col > COL){ 00020 return 0; 00021 } 00022 return 1; 00023 } 00024
Generated on Sun Aug 7 2022 13:40:25 by
1.7.2