From ba7f2234e04451857b99cada3ad56c6dabdfefde Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 13 Sep 2019 05:20:03 -0700 Subject: [PATCH] Fixed some broken features - Shows time correctly upon winning - New game y/n now works instead of always exiting - The "You lost!" screen now stays up until a key is pressed --- games/ms1/minesweeper.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/games/ms1/minesweeper.lua b/games/ms1/minesweeper.lua index 0a9fa4a..b8eb18c 100644 --- a/games/ms1/minesweeper.lua +++ b/games/ms1/minesweeper.lua @@ -164,9 +164,14 @@ function game() print("You lost!") print("Press any key to continue...") local e = event.pull() + e = event.pull() end end +function time(s) + return string.format("%ds",s) +end + -- Program starts print("Hold Ctrl+Alt+C to terminate if stuck") os.sleep(1) @@ -177,7 +182,7 @@ while true do term.clear() print("New game? [y/n]: ") k = term.read() - if k ~= "y" then + if k ~= "y\n" then break end -end \ No newline at end of file +end