The game of 23 is a two-player computer versus player game


Write an HTML page with JavaScript using IF Statement

The game of "23" is a two-player (computer versus player) game that begins with a row of 23 toothpicks. Players take turns, withdrawing 1, 2 or 3 toothpicks at a time. The player to withdraw the last toothpick loses the game.

Write a human-computer webapp that plays "23". The human should always move first. The webapp should prompt the human to select the number of toothpicks (1 to 3 - input validation) when it is the player's turn, and then display the "actual" toothpicks left (using "/-" - add a dash after each slash for readability) followed by the total number of toothpicks left. The game should end gracefully with the computer announcing the winner.

Note: You can use console.log to display testing messages. All game messages will be displayed to HTML page similar to the Sample Output below. Your alerts will process the user moves.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: The game of 23 is a two-player computer versus player game
Reference No:- TGS01459988

Now Priced at $30 (50% Discount)

Recommended (96%)

Rated (4.8/5)