10-karel-introduction

10-karel-introduction - CS 106A Handout #10 June 24, 2009...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Handout #10 CS 106A June 24, 2009 Control Statements in Karel Thanks to Eric Roberts for basically this entire handout The Karel the Robot Learns Java book includes several examples that illustrate the use of control statements in Karel’s world. Whenever possible, I like to solve different problems in lecture so that you can see a different set of examples. Today, for example, I will present the concept of control statements in the context of teaching Karel to climb a mountain. In the text, you can read a similar introduction in the context of having Karel repair potholes in a roadway. By offering both examples, you are in a better position to understand the general principles as opposed to the details of a particular problem. In a lecture, however, I also want to be able to get you to think about the problems and solve them as we go. If I include the solution in the handout, it’s far too tempting just to look at the answer instead of trying to work things out on the fly. Thus, I use these
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/14/2010 for the course CS 106A taught by Professor Sahami,m during the Fall '08 term at Stanford.

Page1 / 2

10-karel-introduction - CS 106A Handout #10 June 24, 2009...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online