Results 1 to 15 of 15
- 05-04-2010, 11:08 PM #1
Member
- Join Date
- May 2010
- Posts
- 4
- Rep Power
- 0
Karel the robot: errors during run
Hi, I find following errors after running the programme (a very simple one)
Exception in thread "Thread-3" acm.util.ErrorException: move: Karel is not living in a world
at stanford.karel.Karel.checkWorld(Karel.java:295)
at stanford.karel.Karel.move(Karel.java:77)
at CollectNewspaperKarel.run(CollectNewspaperKarel.ja va:16)
at acm.program.Program.runHook(Program.java:1568)
at acm.program.Program.startRun(Program.java:1557)
at acm.program.AppletStarter.run(Program.java:1895)
at java.lang.Thread.run(Unknown Source)
I have written a 3 line code:
import stanford.karel.*;
public class CollectNewspaperKarel extends SuperKarel {
public void run(){
move();
turnLeft();
move();
}
}
I do not know whats wrong with it!! its so simple still i do not why,
- 05-05-2010, 01:09 AM #2
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
Most of the forum is not going to know about Karel, as it is pretty much a Stanford-only thing. Do you have your worlds directory, with CollectNewspaperKarel.w in it?
-Gary-
- 05-05-2010, 01:25 AM #3
Member
- Join Date
- May 2010
- Posts
- 4
- Rep Power
- 0
Yes I think I have it. This is actually one of those easy stanford assignments
CS106A Programming Methodology
I downloaded the zip file, extracted it and then loaded it on stanford customized Eclipse..
Thanks for your reply..
Actually I am following these lectures so wanted to do the assignments to get hands-on experience.
Any suggestion is quite valuable for me as its my first programming experience....
- 05-05-2010, 02:02 AM #4
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
Well, I wish I could be more helpful, but all I can say is that there must be something wrong in your setup. Are you running Windows, Mac, or Linux?
-Gary-
- 05-05-2010, 07:54 AM #5
Member
- Join Date
- May 2010
- Posts
- 4
- Rep Power
- 0
windows XP
- 05-05-2010, 05:18 PM #6
Senior Member
- Join Date
- Feb 2010
- Posts
- 128
- Rep Power
- 0
Man, I want to go to Stanford too. Looks sexy
Measuring programming progress by lines of code is like measuring aircraft building progress by weight.
- 05-05-2010, 05:42 PM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
You can participate (watch) on youtube: here is the link.
kind regards,
Jos
- 05-06-2010, 12:41 AM #8
Member
- Join Date
- May 2010
- Posts
- 4
- Rep Power
- 0
working
Hey its working now, I just had to oldstyle delete/reinstall....:D,
but Thanks guys..I have started liking this forum..
- 05-06-2010, 12:57 AM #9
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
I'm glad you got it working. I strongly recommend you take a slight detour from the Stanford CS106A coursework, and go through the tutorial here:
Eclipse and Java for Total Beginners
This is about three hours total, and I think it will really make you feel more at home in the Eclipse environment. CS106A is about computer science principals, and it's an excellent course, but the Mark Dexter tutorials are more about nuts and bolts Eclipse and Java. They're just deep enough to give you a solid understanding, without taking up too much of your time. After you work through these, go back to CS106A, and then follow that up with the Sun Java Tutorials.
-Gary-
- 05-06-2010, 01:16 AM #10
Karel the Robot
Gary suggests a good link,, if your a total noob me. my suggestion would be to do at least the Karel the Robot exercises first to assignment one then mark dexters tutorial,, which is excellent
I'm doing the same course but also doing a lot of detours as I go along.
I had some problems installing the eclipse version provided in the zip file
but the version here worked fine,
CS106A Programming Methodology
Here is a link to the course text books which you wont have got in the stanford Zip file,
Karel the robot learns Java
http://lia.deis.unibo.it/Courses/Fon...learnsjava.pdf
The art and science of Java by Eric Roberts
http://people.reed.edu/~jerry/121/ma...ciencejava.pdf
best of luck
SonnyLast edited by sonny; 05-06-2010 at 01:19 AM.
:p I still have my "L" plates on...... directions and explanations are far more help than blaring your Horn! :p Watching:CS106a on YouTube \Reading The Art & Science of Java by Eric S Roberts
- 04-18-2011, 08:27 PM #11
Member
- Join Date
- Apr 2011
- Location
- New England/Caribbean/Med
- Posts
- 2
- Rep Power
- 0
Stanford CS106A
Maybe we should start a CS106A Forum. I got stumped a number of times as well. Mainly because I did not know how Eclipse worked and I made all kinds of errors, probably corupted the Eclipse program a number of times and had to trash the Workspace files a number of times.
I finally put that on hold and did the 16 tutorials in Mark Dexters "Eclipse and Java for Total Beginners"
Eclipse and Java for Total Beginners
That gave me a level of comfort with Eclipse which really helped when I got back into the Stanford Lectures.
- Cheers
- 04-24-2011, 06:20 PM #12
Member
- Join Date
- Apr 2011
- Location
- New England/Caribbean/Med
- Posts
- 2
- Rep Power
- 0
Stanford U CS 106A & Karel the Robot
I am new to Java. Does anyone know of a forum (or would want to start one) for Stanford Eclipse - or for their course " CS106A" ? I've had to modify or add to some of the Eclipse for JAVA assignments in CS106A in order to duplicate the problems shown in the Lectures and in the Assignments. I've had to create and save Worlds for Karel to run around in, etc. It has not been easy but I've begun to get a handle on it. I did the Turtorial "Java for Total Beginners" mentioned in this forum and that really helped. But, I seem to be spending more time trying to learn the ins & out of Eclipse rather than focusing on coding; syntax, decomposing, debugging, etc. which is the real heart of it (I think). Were I an on-campus student in the course, rather than taking the online (free!), lectures and course; I think I would have had a though time. I don't know how those kids do it. Anyway, I am here to help with what I know thus far but realize I am wasting a lot of time just getting to this point. It would be a real help to just ask: How do you create a new World for Karel to run in, save it as a Unix Executable file rather than a "txt" file and associate it with the Java Project or Java Class I'm working with. Those questions took me two days of searching and trial & error with Eclipse to find the answer.
- 01-10-2012, 06:57 AM #13
Member
- Join Date
- Jan 2012
- Posts
- 1
- Rep Power
- 0
Re: Karel the robot: errors during run
> How do you create a new World for Karel to run in, save it as a Unix Executable file rather than a "txt" file and associate it with the Java Project or Java Class I'm working with. Those questions took me two days of searching and trial & error with Eclipse to find the answer.
Several Karel examples have worlds associated with them that appear when the program is run. I would like to replicate the examples in the lectures by creating worlds (which is easy and I know how to do), but also associating them with the particular program I'm writing/demonstrating. I can use the "Load World" option, but would rather have the world loaded automatically when I run the program. Any ideas of how to do that without having the Karel code (just the .jar file)?
- 03-17-2012, 12:01 AM #14
Member
- Join Date
- Mar 2012
- Posts
- 1
- Rep Power
- 0
Re: Karel the robot: errors during run
http://see.stanford.edu/materials/ic...in-eclipse.pdf
I think you need to hit the icon of the little man rather than loading a world.
Hope that helps.
- 06-17-2012, 04:12 AM #15
Member
- Join Date
- Jun 2012
- Posts
- 1
- Rep Power
- 0
Re: Karel the robot: errors during run
I just ran into this problem using standard (not Stanford) Eclipse. By now this is probably moot for you, but I'll post my solution for future travelers.
The launch configurations for Assignment 1 default to Applet, so the containing Karel application isn't launched. To solve this, create and use new Application launch configurations for each file.
If you already tried to run some of the files, delete the Applet configs created so you can reuse the names:
1. Open the project properties (e.g. right click on Assignment 1 and select Properties).
2. Select Run/Debug Configurations.
3. Select and Delete each configuration.
4. Click OK.
Create Application configs:
1. Right click on java file (e.g. CollectNewspaperKarel.java) and select Run As > Run Configurations...
2. Select Java Application in the left pane.
3. Click New Launch Configuration (the icon of a document with a +).
4. Type a name for the configuration and set its Main class to the associated file (e.g. CollectNewspaperKarel).
5. Click Apply then Run. (This should run correctly and create a useful entry in the Run History.)
Eclipse will still try to default to Applet, so you will henceforth need to launch these configurations from the Run History (either from the Run menu or the pull down on the run button). If you accidentally launch as default, it will add a useless Applet configuration to the Run History (e.g. CollectNewspaperKarel (1) ). You can delete this from the Run Configurations dialog to keep the Run History tidy.
May the Force be with you.
Similar Threads
-
Robot Game
By Galore in forum New To JavaReplies: 7Last Post: 03-21-2010, 06:14 PM -
Help with Robot Class
By protocos in forum EclipseReplies: 11Last Post: 10-05-2009, 08:15 PM -
Karel the robot
By vulerious in forum New To JavaReplies: 0Last Post: 07-31-2009, 09:48 PM -
What is the difference between Semantic Errors and Logical Errors?
By tlau3128 in forum New To JavaReplies: 3Last Post: 03-08-2009, 01:51 AM -
Robot Class
By Jessie Madman in forum New To JavaReplies: 3Last Post: 05-15-2008, 04:13 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks