how to do a game that is simulated by a loop [closed]
how to do program a game that is simulated by a loop in which people has to repeat goes for as long as it takes to get out that it reach or pass square 80? I am doing a snake & ladder game and need to write a code that will allow this to happen
You need to use a loop with an exit condition that checks if a player has reached square 80 or otherwise won.
while ( !hasPlayerWon() ) {
//continue game
}
loops in javascript, loops in C++ :D
精彩评论