From 45a4381ff979f52a313a183fee3cb91e29d9e9e3 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Mon, 25 Oct 2004 12:28:57 +0000 Subject: Patch #1052007 by Philipp Pertermann, minesweeper no longer quits after finishing a game. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5343 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/minesweeper.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index e60cfb4688..81ed24096a 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -234,6 +234,7 @@ void minesweeper_init(void){ void minesweeper_putmines(int p, int x, int y){ int i,j; + mine_num = 0; for(i=0;irand()%100

splash(HZ*2, true, "You Win :)"); - break; - - case MINESWEEPER_LOSE: - rb->splash(HZ*2, true, "You Lost :("); - break; - - case MINESWEEPER_USB: - return PLUGIN_USB_CONNECTED; - - default: - break; + while(!exit) { + switch(minesweeper()){ + case MINESWEEPER_WIN: + rb->splash(HZ*2, true, "You Win :)"); + break; + + case MINESWEEPER_LOSE: + rb->splash(HZ*2, true, "You Lost :("); + break; + + case MINESWEEPER_USB: + return PLUGIN_USB_CONNECTED; + + case MINESWEEPER_QUIT: + exit = true; + break; + + default: + break; + } } return PLUGIN_OK; -- cgit v1.2.3