Results 1 to 1 of 1
Thread: Using a queue
- 12-10-2007, 04:38 PM #1Member
- Join Date
- Dec 2007
- Rep Power
Using a queue
First of all, Hi!
So here is my problem, I am writing a simple game in which the user enters directions into the console to move a robot around a room, in which there are various pits it could fall in to. The way I wish to do this is to use a randomizer to throw random possible directions into a queue, presenting the user with 3 possible moves to choose from.
Each time it would throw more moves into the queue, until the user reaches the required target for the game to complete. On top of this the robot would have a 50% chance of making a random move.
How would one go about implementing the queue and throwing random directions into it?
The directions are those of a compass, N, S, E ,W, NE, NW, SE, SW.
Thank you for any help.
- By Java Tip in forum java.langReplies: 0Last Post: 04-14-2008, 09:35 PM
- By Java Tip in forum java.langReplies: 0Last Post: 04-12-2008, 09:49 PM
- By rhm54 in forum New To JavaReplies: 1Last Post: 03-21-2008, 06:02 AM
- By vmcg105 in forum New To JavaReplies: 1Last Post: 03-08-2008, 08:03 PM