File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -800,15 +800,15 @@ def snake_embedded_keyscan():
800800 send_command (dev , CommandVals .GameControl , [key_arg ])
801801
802802
803- def game_over ():
803+ def game_over (dev ):
804804 global body
805805 while True :
806- show_string ('GAME ' )
806+ show_string (dev , 'GAME ' )
807807 time .sleep (0.75 )
808- show_string ('OVER!' )
808+ show_string (dev , 'OVER!' )
809809 time .sleep (0.75 )
810810 score = len (body )
811- show_string (f'{ score :>3} P' )
811+ show_string (dev , f'{ score :>3} P' )
812812 time .sleep (0.75 )
813813
814814
@@ -850,7 +850,7 @@ def snake_embedded():
850850 snake_embedded_keyscan ()
851851
852852
853- def snake ():
853+ def snake (dev ):
854854 from getkey import keys
855855 global direction
856856 global body
@@ -892,7 +892,7 @@ def snake():
892892 # Detect edge condition
893893 (x , y ) = head
894894 if head in body :
895- return game_over ()
895+ return game_over (dev )
896896 elif x >= WIDTH or x < 0 or y >= HEIGHT or y < 0 :
897897 if WRAP :
898898 if x >= WIDTH :
@@ -905,7 +905,7 @@ def snake():
905905 y = HEIGHT - 1
906906 head = (x , y )
907907 else :
908- return game_over ()
908+ return game_over (dev )
909909 elif head == food :
910910 body .insert (0 , oldhead )
911911 while food == head :
@@ -922,7 +922,7 @@ def snake():
922922 for bodypart in body :
923923 (x , y ) = bodypart
924924 matrix [x ][y ] = 1
925- render_matrix (matrix )
925+ render_matrix (dev , matrix )
926926
927927
928928def wpm_demo ():
@@ -944,7 +944,7 @@ def wpm_demo():
944944 if total_time < 10 :
945945 wpm = wpm / (total_time / 10 )
946946
947- show_string (' ' + str (int (wpm )))
947+ show_string (dev , ' ' + str (int (wpm )))
948948
949949
950950def random_eq (dev ):
You can’t perform that action at this time.
0 commit comments