Learning Java with Karel the Robot

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
9,224
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 23, 2008

These are my solutions to the 1st programming assignment from Stanford's Programming Methodology FREE classes.

Thanks to the Stanford University for providing free educational material, checkout their site:

http://see.stanford.edu

find the code in:
http://github.com/victornava/stanford-karel

Category:

Music

Tags:

License:

Standard YouTube License

  • likes, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (AVANROTCIV)

  • I dont know the requirements, but isnt seeking the middle easy as this; int width; int stepsback; if(!infrontWall) { width++; move(); } else { widht--; stepsback=width/2; walk(stepsback); } public void walk(int stepsback) { for(int i = 0; i < stepsback; i++) { move();  } }
  • @Frietjestoof can't use variables

  • I just finished solving all the assignments, so I decided I'd go on youtube and checkout how other people solved the problems. It's good to see that you solved them, but they seem kind of unorganized. I'm not sure how you did the midpoint and checkerboard problems! Your Karel seems to take the long route on things :P. Interesting nonetheless!

  • @GioV45 I did it so it works without having to go up and down

  • @AVANROTCIV Oh, well my Karel simply fills the first row with beepers then picks ups up the beepers at each end until he picks up the last beeper, moves one space forward, one space back, and then places a beeper down again

  • @GioV45 that's definitely faster!

see all

All Comments (41)

Sign In or Sign Up now to post a comment!
  • @606huyen606 Its better not to use any ints in this program. Just do if and while statements, and logically solve them in your head before typing out random code :D

  • i'm stuck with checker board and wonder which method to use. Also when i use method for(int i=0;i<4;i++){putBeeper();move(­);if(frontIsBlocked()){turnLef­t();}if(frontIsClear()){move()­;}}}} it works for the world 8x8 but in 6x5 my Karel went up 2 steps. Just wonder that u can help me

  • I am a high school student doing CS106A Stanford University. And I am stuck on Karel trying to get the checkerboard and I can't get it to do it properly. Could you tell me the method you used?

    Thanks

  • Whats your algorithm? I can't figure out the checker board one....

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more