79786623

Date: 2025-10-09 16:06:25
Score: 2
Natty:
Report link

getch() returns two keystrokes for arrow keys. First an extended-key prefix (0 or 224), then the actual code ('H','P','K','M'). Your loop prints the board before reading the full arrow key, so the first getch() reads only the prefix (no move happens), the loop iterates and prints again, and only then the second getch() reads the real arrow code—making it look like the board prints twice. Fix it by swallowing the prefix and printing after you handle the move.

Reasons:
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Christos Polimatidis