Questions tagged [karel]

Karel is an introductory programming language in which one controls a simulated robot.

Karel is an introductory programming language designed by Richard Prattis in 1981 at Stanford University in order to teach basic programming syntax and operations.

Additional libraries and languages have been built based on Karel, including Karel++ and becker.robots for Java to more accurately cover object-oriented programming syntax.

45 questions
6
votes
10 answers

Stanford's Karel the Robot throws NullPointerException

I have started taking the course Programming methodology(CS106A) available at stanford website. But I am not able to start the Stanford Karel in it. I am using eclipse indigo classic 3.7.1 and Windows 7 64 bit OS.. I wrote the following code: import…
bhuwansahni
  • 1,834
  • 1
  • 14
  • 20
5
votes
1 answer

Random number in 1991 Pascal

I am running a Fenuc Karel robot for a class assignment which uses a variation of Pascal however our robot is from 1991-1993 before they added random(). Does anyone know how to get a random number on an old dos implementation of Pascal? Please note…
HDeffo
  • 51
  • 1
4
votes
0 answers

Java algorithm assistance

So my current task is to create an algorithm that shifts the piles of beepers in a row 1 space to the right. I think I have a good start, I wrote the code to pick up a pile of beepers, move one to the right, and drop those beepers: public static…
Sam
  • 43
  • 5
3
votes
4 answers

Karel screen is blank when trying to run in Eclipse on Mac

I'm currently doing the online CS106A Stanford course. As part of this I need to install Eclipse and get Karel running I installed Eclipse using their up to date version of Eclipse, installed using instructions from here:…
geoffricho
  • 31
  • 3
2
votes
2 answers

Unable to start Stanford's CS106A Eclipse version - "Unable to access jarfile startup.jar" on Mac 10.6

I've been trying to do the Stanford CS106A course through iTunesU, but I keep running into problems with Eclipse. I tried getting Stanford's custom version with Karel, but that kept giving the "unable to access jarfile startup.jar" error. I even…
ROldford
  • 310
  • 1
  • 3
  • 12
2
votes
2 answers

Karel Robot: Could not find or load main class

I run this command to compile, it runs successfully: javac -d . -cp .;KarelJRobot.jar StairClimber.java Then I use this to try and run my class: java -d –cp .;KarelJRobot.jar StairClimber and I get this: Error: Could not find or load main class…
Hudspeth
  • 146
  • 13
2
votes
2 answers

slow down execution of javascript's eval

I have created a little robot like the Karel robot (Wikipedia) which is based on javascript. Karel4Web The robot can be controlled with some simple commands such as "forward", "turnright" and so on. The user can write a javascript program to control…
2
votes
5 answers

How does Karel run without "main" method?

I was wondering in the program like Karel the Robot runs because it does not used main() method. Instead it used run() method: import stanford.karel.Karel; public class CollectNewspaperKarel extends Karel { public void run() { move(); }…
user3276091
  • 263
  • 3
  • 10
1
vote
7 answers

Syntax error on token "else" — how on earth?

I'm learning Java the classic way — by playing around with Karel. But I seem to have encountered a simple problem I can't solve even with the help of Google. I'm getting an error in Eclipse saying there's a syntax error on the token "else", and that…
Sweely
  • 386
  • 3
  • 15
1
vote
0 answers

Delete a certain sentence from terminal window

I would like to delete the sentence "RobotID.....on" from appearing every time I use the scanner for Karel Robot. Is there a way to do it? I tried using system.out.flush(); to see if it would reset my whole terminal window but it doesn't.
1
vote
3 answers

Python conditions with parenthesis in a while not loop

So I'm learning programming with Karel and I'm a little confused about conditionals with parenthesis and specifically what would happen in a loop. def build_line(): while not (front_is_blocked() or beeper_is_present()): face_east() …
hsuehtt98
  • 13
  • 2
1
vote
1 answer

Karel Robot in Python for teaching students

Have a nice morning, Together with a lecturer I am preparing the world of the robot Karl for teaching Python at the university, which not only memories are surely familiar. The world is already ready, the application uses the TKInter library. I have…
1
vote
2 answers

How to get Karel to put beepers everywhere?

This is the code that I tried. function main() { while (frontIsClear()) { //this tells karel to go and put beepers putBeeper(); move(); } if (frontIsBlocked()) { //this tells karel to change the direction if there's a wall …
anon
  • 73
  • 9
1
vote
2 answers

FANUC KAREL XML parser

maybe here is someone who knows FANUC KAREL a little bit. I have to create a XML parser, to get specific parts of a telegram. I started with the FANUC template code, but currently I get no results. Nothing. Here you can see the message, I have to…
KaiF
  • 23
  • 5
1
vote
1 answer

mfc42.dll segfault with ktrans

I'm not sure if this problem is oddball or trivial. The background is the following: We have a FANUC robot in our lab, that can be interfaced via their proprietary KAREL language (I'm just realizing that my tag is probably misleading). A technician…
1
2 3