• Log in or sign up for an account here: https://www.sythe.org/login

Programming Fundamentals [Coding]

Jeff

Previously named: Jeff.

Joined
Apr 16, 2011
Sythe Gold
3,205
Messages
11,444
Location
¯\_(ツ)_/¯
MushyMuncher
Two Factor Authentication User
Christmas 2014
Christmas 2015
Easter 2016
Extreme Homosex
Homosex
Lawrence
Pizza Muncher
Sythe's 10th Anniversary
SytheSteamer
Hey guys, ultra stuck on this uni problem.

So I'll post the question, available commands and the code:

effeeca526.png


tldr

Need to guide the beetle (Clara) through the maze until she finds the leaf. Once on the leaf, Clara needs to eat the leaf and stop.

The code needs to be generic enough to work in any maze scenario.


94d9378d50.jpg



c14f9cc5dc.jpg



cbaede2e46.png


From memory, there's a stop(); command. If such command is not needed, then don't worry about it.


*removed*


If that doesn't work, here is MyClara.java:

Code:
/**
 * MyClara is a subclass of Clara. Therefore, it inherits all methods of Clara: <p>
 * 
 * PERMITTED COMMANDS
 * Actions:     move(), turnLeft(), turnRight(), putLeaf(), removeLeaf()
 * Sensors:     onLeaf(), treeFront()
 * JAVA:        if, else, while, for, !, &&, ||
 */
public class MyClara extends Clara 
{   
    /**
     * In the 'run()' method you can write your program for Clara <br>
     */
    public void run() 
    {
		// TODO: Write your code below
		
    }

}


If anything is unclear, please ask.

Thanks.

Edit: Download link: http://wikisend.com/download/217686/P3_code(5).zip
 
This looks kind of fun. Message me on Skype and I will help guide you through it (for free of course) :P
 
MushyMuncher
Two Factor Authentication User
Christmas 2014
Christmas 2015
Easter 2016
Extreme Homosex
Homosex
Lawrence
Pizza Muncher
Sythe's 10th Anniversary
SytheSteamer
The link needs a login :/ - if you can give us a direct download I can walk you through this tonight. Added you on skype as well

Accepted your request.

This looks kind of fun. Message me on Skype and I will help guide you through it (for free of course) :P

I think I only have your old Skypes added.

I was about to add your new Skype (KMJTtrade), however 3 different ones popped up in my search, and I can't tell which one is you because I'm using gay Windows 8.

If you're able to add me on your new one or message me from one of your old ones, that'd be awesome.

Skype: jefff3.

Cheers guys


Edit: Download link: http://wikisend.com/download/217686/P3_code(5).zip
 
Lanturn
Toast Wallet User
Do you still need help with this?
 
Just curious, is this an algorithm course?
 
Hey Jeff,

I'm stuck on problems 2 and 3 of this weeks prac as well.

Any help or hints with the code would be highly appreciated.

Thanks in advance
 
Keep track of your moves on a stack. When you have to backtrack (go back from where you came) pop the stack. This way you'll know where you came from wherever you are.

Ex
up, up, right (backtrack and pop) -> up up
So you know not to go down or to the right (because you just came from there). Which leaves the only option of up.
 
Hey Jeff,

I'm stuck on problems 2 and 3 of this weeks prac as well.

Any help or hints with the code would be highly appreciated.

Thanks in advance




Lool who is this guy? Jeff your classmate is stalking you bruh. His game is strong.
 
Bump.

Still need assistance please.

How about trying something first, and then ask a question. No one is going to do it for you unless you pay them. I explained in my last post how it can be done.
 
Air Fryer
DIAF
m`lady
Le Kingdoms Player
STEVE
Creamy
Sythe Awards 2016 Winner
Pool Shark
Two Factor Authentication User
If you want to pm me the info, I'll give it a look this afternoon and hopefully have something that will help you written this evening. Sorry, just been really, really busy these past ten days (and next five) or so.
 
Runescape Gamblingrunescape gambling
Back
Top