• Help with Java
    0 replies, posted
Hey guys I just started college and I am doing a computer applications course. We are doing Java at the moment. I was looking for some help with an assignment. Here is the basic overview. (Note the lecturer is pretending that the robot is a pirate, which explains the odd treasure references etc) [LIST=1] [*] Go to the decision cell. That is ... start at the pirate's base (origin) and head north eight paces. Turn east and go six paces. [*] This is the decision cell; there will be an unknown pile of beepers in this cell. [*] Your robot must make a life or death decision; it must turn north if there are an even number of beepers on the cell and it must turn south if there are an odd number of beepers in the cell. [*] After you've made the decision (i.e. turning north/south), move forward one pace and pick up the treasure (you've guessed it - more beepers). If you take the wrong direction, you'll hit the mine and lose. [*] But if you take the right turn ...congratulations, you are lavished in beepers and live happily ever after ... or at least until the law catches up with you. [/LIST] Now what I am not sure of is how to make this unknown pile of beepers, and how we make the robot decide between choosing an odd or even number, as we have not been shown a command for how to do that. Any help would be greatly appreciated! Thanks boys,
Sorry, you need to Log In to post a reply to this thread.