Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me



Go Back   Dev Hardware ForumsSOFTWAREProgramming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Hardware Forums Sponsor:
  Trader Rating: 0 · #1  
Old February 13th, 2013, 08:19 AM
jamievalley jamievalley is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 1 jamievalley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 7 sec
Reputation Power: 0
Java - DrJava

Hi, I'm new to Dr.Java and I'm not sure how to work it. I'm trying to finish UPenn's better bot assignment. I'm suppose to build of the bot code but I'm not sure how to even start.

Here is the code:

/**
* A BetterBot extends Bot to make a better Bot.
* @author UPenn CIS BotWorld
* @version 2009 Jan 23
*/
public class BetterBot extends Bot{

/**
* Constructs a new BetterBot in the given world.
* @param world the world in which the bot should reside
*/
public BetterBot(BotWorld world){
/**
* This line takes the current object and initializes it
* as a Bot. We'll explain exactly how this works later
* in the course.
*/
super(world);
}

/**
* Moves the bot "backward" one space, but should end up facing
* the same direction as it started.
* If the bot cannot move backward, it should return false and
* remain in its original location facing its original direction.
* @return whether the backup was successful
*/
public boolean backup(){
bot.turnLeft();
bot.turnLeft();


}

/**
* Turns around while staying in the same location.
* @return the direction the bot ends up facing
*/
public char turnAround(){
return 'n'; // REPLACE THIS LINE WITH YOUR SOLUTION
}

/**
* Moves and tries to eat.
* Assumes that the bot can move forward one space.
* Moves forward one space and then tries to eat a dot.
* Returns whether it ate a dot.
* @return whether the bot ate a dot from the new location
*/
public boolean moveAndEat(){
return false; // REPLACE THIS LINE WITH YOUR SOLUTION
}

/**
* Spins the bot 360 degrees in either direction while staying in the same location.
*/
public void spin360(){
// REPLACE THIS LINE WITH YOUR SOLUTION
}

/**
* Eats a dot from the current location, moves
* forward one space, and puts the dot in the
* new location. Assume this is possible.
*/
public void grabAndDrop(){
// REPLACE THIS LINE WITH YOUR SOLUTION
}

/**
* Moves in a 2x2 square using right turns, starting by moving
* in its current direction, and ending up in its starting cell,
* facing its original direction. Assume this is possible.
* Examples: a bot at (0,0) facing east
* should go to (1,0) then (1,1), then (0,1), then back to (0,0)
* facing east; a bot at (1,1) facing west should go to (0,1) then
* (0,0) then (1,0) then (1,1) facing west.
*/

public void squareDance(){
// REPLACE THIS LINE WITH YOUR SOLUTION
}

/**
* Turns the bot so that it ends up facing south.
*/
public void faceSouth(){
// REPLACE THIS LINE WITH YOUR SOLUTION
}

/**
* Returns whether the cell directly in front
* of the bot is a wall. This method should
* use the world's isWall method.
* @return whether the cell directly in front
* of the bot is a wall
*/
public boolean isFacingWall(){
return false; // REPLACE THIS LINE WITH YOUR SOLUTION
}

/**
* Using at least two of the BetterBot methods you
* just wrote, do something crazy!
*/
public void fancyDance(){
// REPLACE THIS LINE WITH YOUR SOLUTION
}

Reply With Quote
  Trader Rating: 0 · #2  
Old February 15th, 2013, 10:22 PM
JohnFrank's Avatar
JohnFrank JohnFrank is offline
Contributing User
Click here for more information. Click here for more information
Click here for more information
 
Join Date: Jan 2008
Location: Lilyfield NSW Australia
Posts: 2,149 JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)JohnFrank User rank is General 135th Grade (Above 100000 Reputation Level)  Folding Points: 25499921 Folding Title: Super Ultimate Folder - Level 51Folding Points: 25499921 Folding Title: Super Ultimate Folder - Level 51Folding Points: 25499921 Folding Title: Super Ultimate Folder - Level 51Folding Points: 25499921 Folding Title: Super Ultimate Folder - Level 51Folding Points: 25499921 Folding Title: Super Ultimate Folder - Level 51Folding Points: 25499921 Folding Title: Super Ultimate Folder - Level 51Folding Points: 25499921 Folding Title: Super Ultimate Folder - Level 51Folding Points: 25499921 Folding Title: Super Ultimate Folder - Level 51Folding Points: 25499921 Folding Title: Super Ultimate Folder - Level 51Folding Points: 25499921 Folding Title: Super Ultimate Folder - Level 51
Time spent in forums: 3 Months 4 Weeks 1 Day 3 h 28 sec
Reputation Power: 9968
Send a message via MSN to JohnFrank
Facebook
Looks like a school project / assignment. We cannot answer your assignments for you.
__________________

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWAREProgramming > Java - DrJava


Developer Shed Affiliates

 


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
     
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap