From a4ac18ffa2d0078499bfcb5146dae079c1237f34 Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Thu, 16 Jul 2015 11:46:52 -0500 Subject: [PATCH] Allow you to wrap around the edges with the cursor. --- a2sudoku/ui.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/a2sudoku/ui.c b/a2sudoku/ui.c index d094ea7..065b61e 100644 --- a/a2sudoku/ui.c +++ b/a2sudoku/ui.c @@ -557,6 +557,10 @@ bool playGame(void) cursorY--; refreshPos(cursorX, cursorY); refreshPos(cursorX, cursorY + 1); + } else { + cursorY = BOARD_SIZE - 1; + refreshPos(cursorX, cursorY); + refreshPos(cursorX, 0); } break; @@ -567,6 +571,10 @@ bool playGame(void) cursorX--; refreshPos(cursorX, cursorY); refreshPos(cursorX + 1, cursorY); + } else { + cursorX = BOARD_SIZE - 1; + refreshPos(cursorX, cursorY); + refreshPos(0, cursorY); } break; @@ -577,6 +585,10 @@ bool playGame(void) cursorX++; refreshPos(cursorX, cursorY); refreshPos(cursorX - 1, cursorY); + } else { + cursorX = 0; + refreshPos(cursorX, cursorY); + refreshPos(BOARD_SIZE - 1, cursorY); } break; @@ -587,6 +599,10 @@ bool playGame(void) cursorY++; refreshPos(cursorX, cursorY); refreshPos(cursorX, cursorY - 1); + } else { + cursorY = 0; + refreshPos(cursorX, cursorY); + refreshPos(cursorX, BOARD_SIZE - 1); } break;