Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-10-2007, 05:38 PM
Member
 
Join Date: Dec 2007
Posts: 3
Krmeus is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Queue data structure Java Tip java.lang 0 04-14-2008 10:35 PM
How to implement Priority queue with Java Java Tip java.lang 0 04-12-2008 10:49 PM
Declaring a Queue rhm54 New To Java 1 03-21-2008 07:02 AM
Help with queue array please!! vmcg105 New To Java 1 03-08-2008 09:03 PM


All times are GMT +3. The time now is 03:55 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org