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;