Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2012
    Rep Power

    Default Need help with Java program: You Go Last

    Hello. I need urgent help with a question I have been given for an assignment. Here is the question.

    The game of “You Go Last” is an ancient Tibetan game played with three piles of stones. In this version there are three stones in the first pile, five stones in the second pile and eight stones in the third pile. Two players alternate in taking as many stones as they like from any one pile. Play continues until someone is forced to take the last stone, and in doing so looses the game.

    Write a program that will ask for the names of the two players and then keep track of the game of “You Go Last” as they play TWO games. It is important that whoever goes first in the first game doesn’t go first in the second game. The program should not allow a player to make an illegal move, and should tell the player via an error message what they need to do to correct their “mistake”. It will also announce when the game has been won. When both games are over the program should tell the players who won, or if it was a tie (that is, each player won one game each).

    An array must be used to hold the values of how many stones are in each pile.

    Any suggestions to how I can target this?


  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Need help with Java program: You Go Last

    Moved from Advanced Java. Please don't post any more beginner homework questions in that section.

    This is a forum not a code mill, so show your best efforts and ask a specific question to get help here. As it stands at present, it looks like you are expecting someone to do your homework for you, and that isn't going to happen.

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DrummondAW is offline Member
    Join Date
    Oct 2012
    Rep Power

    Default Re: Need help with Java program: You Go Last

    It's actually pretty simple. Just break the assignment down into small pieces and then fit everything together. When you look at something as a whole it can often look more complex than it really is.

Similar Threads

  1. Call one Java Program from another Java Program
    By rajpalparyani in forum New To Java
    Replies: 3
    Last Post: 02-14-2011, 04:13 AM
  2. Replies: 4
    Last Post: 07-30-2010, 12:25 PM
  3. execute java program within java program
    By popey in forum New To Java
    Replies: 2
    Last Post: 10-22-2009, 05:32 PM
  4. Replies: 0
    Last Post: 04-04-2008, 02:40 PM
  5. Replies: 0
    Last Post: 10-04-2007, 09:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts