Yes, this is homework. I completed the assignment in it’s entirety. Just need to make an alert box for when the player finishes the game and wins.
If the user clicks “OK”, then the confirm box will disappear, and a new random board will be displayed, as if “Start a New Game” was clicked.
If the user clicks “Cancel”, then the confirm box will disappear, and the display will remain with the tiles in the winning position, same as when the page was initially loaded. The user may click “Start a New Game” to start a new game.
LINK to the actual assignment: http://www.eveo.org/tiles/ver2
JAVASCRIPT file link: http://www.eveo.org/tiles/ver2/game.js
I’m not looking in changing anything else, just need this alert box problem fixed. So far I have (in pseudo code):
if win = true
confirm box ("You won! Congratulations! Would you like another game?")
upon pressing OK: board randomized
upon cancel: nothing happens, used needs to click "start a new game"
breakgoes inswitch,forandwhileconstructs only. Don’t put it anywhere else. If you don’t want to do anything onelse, either leave it empty or just remove it altogether.