MatchStick Game 3

Description:     Program for matchstick game being played between the computer and the user.It ensures that computer always wins.
Rules for the games are as follows:
           1. Number of matchsticks are entered by user.
           2. The computer asks the player to pick 1,2 or 3 matchsticks.
           3. After the person picks, the computer does its picking and vice versa.
           4. Whoever is forced to pick up the last matchstick loses the game.

 

Rate this post

3 thoughts on “MatchStick Game

  1. Reply tulsi jain Jun 10,2014 11:45 am

    if we enter total matchstick as 4 then if user is picking 3 matchstick then this program will not wrk i guess

    • Reply Payam Rastogi Jun 27,2014 12:32 pm

      Hi Tulsi,
      I think there is some rule with the game that the Number of matchsticks should be greater than or equal to 5

      • Reply Anupam Jain Jul 11,2014 3:14 pm

        Actually if the total matchsticks are 4 then computer would play first as the if block in main method checks for.
        I hope that explains your doubt.

Leave a Reply