change \a to beep()
authorGeoffrey Allott <geoffrey@allott.email>
Tue, 6 Dec 2022 19:15:09 +0000 (19:15 +0000)
committerGeoffrey Allott <geoffrey@allott.email>
Tue, 6 Dec 2022 19:15:09 +0000 (19:15 +0000)
snake.py

index 94c5ba88b083f4cac059a657a69d64b11353e4b1..664eab9d30c4163c5f79488ab6e506bb1cea1ca5 100644 (file)
--- a/snake.py
+++ b/snake.py
@@ -88,22 +88,22 @@ class GameArea:
         ch = self.win.getch()
         if ch == curses.KEY_LEFT or ch == ord('h'):
             if self.dir == Direction.Right:
-                print('\a', end='')
+                curses.beep()
             else:
                 self.dir = Direction.Left
         if ch == curses.KEY_RIGHT or ch == ord('l'):
             if self.dir == Direction.Left:
-                print('\a', end='')
+                curses.beep()
             else:
                 self.dir = Direction.Right
         if ch == curses.KEY_UP or ch == ord('k'):
             if self.dir == Direction.Down:
-                print('\a', end='')
+                curses.beep()
             else:
                 self.dir = Direction.Up
         if ch == curses.KEY_DOWN or ch == ord('j'):
             if self.dir == Direction.Up:
-                print('\a', end='')
+                curses.beep()
             else:
                 self.dir = Direction.Down
         if ch == 27 or ch == ord('p'):