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 11-26-2007, 09:56 AM
Member
 
Join Date: Nov 2007
Posts: 1
jesse is on a distinguished road
becker.robots problem.
I really need help with this problem. I have tried alot of methods to do this but my attempts are just simply not good enough.

My problem is -

# TopSoil01.cty
# Window title
Spread Top Soil: Test Case
# first street, first avenue, num streets, num avenues
0 0 30 10
# intersection size
38

# There is a Robot that likes to garden. In the spring
# the Robot needs to spread topsoil in her garden beds.
# There is a large pile of topsoil in the intersection immediately
# in front of her. You may assume that there is more than
# enought topsoil. The topsoil is to be spread on the
# other side of a stone wall.
#
# Program the gardening Robot to spread the topsoil one wheelbarrow
# at a time on the East side of the wall. Unfortunately
# the Robot does not know how long the wall is to the left and
# to the right, and so it has to first determine how many steps there
# are to the left end of the wall and how many there are to the right.
# Having determined this, the robot will return to the pile of topsoil
# and begin to carry loads around the wall in the shorter direction.
# Of course, at some point, it will become a shorter trip for the robot
# if it takes a load in the other direction. Your program must determine
# this.

# Also note that the robot needs to stop taking loads when every
# location on the other side of the wall has had one pile of
# topsoil dumped.

#In your program, you must instantiate a Robot as shown below.

#becker.robots.Robot 8 2 Direction.WEST

#The garden wall
becker.robots.Wall 3 4 Direction.WEST
becker.robots.Wall 4 4 Direction.WEST
becker.robots.Wall 5 4 Direction.WEST
becker.robots.Wall 6 4 Direction.WEST
becker.robots.Wall 7 4 Direction.WEST
becker.robots.Wall 8 4 Direction.WEST
becker.robots.Wall 9 4 Direction.WEST
becker.robots.Wall 10 4 Direction.WEST
becker.robots.Wall 11 4 Direction.WEST
becker.robots.Wall 12 4 Direction.WEST
becker.robots.Wall 13 4 Direction.WEST
becker.robots.Wall 14 4 Direction.WEST

becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
becker.robots.Thing 8 3
# Add more things for longer walls by copying the above
# statements as many times as necessary.
__________________________________________________ _______________
All i am asking is how about would you go thru with this problem. eg what loops will you use or how would you deal this with what steps.
I have been cracking this problem for about 5hours and i still cant figure this out. All help are greatly appreciate and Thank you for your time.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-27-2007, 12:25 AM
Member
 
Join Date: Nov 2007
Posts: 1
aadil_khan is on a distinguished road
how can we do that../
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
How to control robots and other devices francojava Advanced Java 0 01-24-2008 06:03 PM
Need help with becker robots problem please. L67Pontiac New To Java 1 07-06-2007 09:50 PM


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


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