Boğaziçi Ünv.
2015
Darüşşafaka
Lisesi. 2014
Koç Ünv. 2016
Asena
Bryce
Julia
Nick
Chris
Lisa
Great team!... Some of them were in your place just 2 years ago
Pelin
Stanford?
Stanford
Logistics
Prerequisites
Course Website
http://csbridge.org
*note that its org not com
Very High Level
Breakout
What if I fall behind?
Share Ideas Not Code
Karel Speaks Java
s
Karel’s World
3
+
+
+
+
+
2
+
+
+
+
+
1
+
+
+
+
+
1
2
3
4
5
North
West
East
South
Knows Four Commands
move();
turnLeft();
putBeeper();
pickBeeper();
Walls
3
+
+
+
+
2
+
+
+
+
1
+
+
+
+
1
2
3
4
Beepers
3
+
+
+
+
2
+
+
+
+
1
+
+
+
+
1
2
3
4
move();
move();
3
+
+
+
+
2
+
+
+
+
1
+
+
+
+
1
2
3
4
move();
3
+
+
+
+
2
+
+
+
+
1
+
+
+
+
1
2
3
4
turnLeft();
turnLeft();
3
+
+
+
+
2
+
+
+
+
1
+
+
+
+
1
2
3
4
turnLeft();
3
+
+
+
+
2
+
+
+
+
1
+
+
+
+
1
2
3
4
pickBeeper();
pickBeeper();
3
+
+
+
+
2
+
+
+
+
1
+
+
+
+
1
2
3
4
pickBeeper();
3
+
+
+
+
2
+
+
+
+
1
+
+
+
+
1
2
3
4
Questions?
First Challenge
3
+
+
+
+
2
+
+
+
+
1
+
+
+
+
1
2
3
4
First Challenge
3
+
+
+
+
2
+
+
+
+
1
+
+
+
+
1
2
3
4
Need a Volunteer
Lets Try It
Anatomy of a Program
import stanford.karel.*;
public class OurKarelProgram extends Karel {
public void run() {
move();
pickBeeper();
move();
turnLeft();
move();
turnRight();
move();
putBeeper();
move();
}
}
private void turnRight() {
turnLeft();
turnLeft();
turnLeft();
}
Anatomy of a Program
import stanford.karel.*;
public class OurKarelProgram extends Karel {
public void run() {
move();
pickBeeper();
move();
turnLeft();
move();
turnRight();
This is the program's
move();
source code
putBeeper();
move();
}
}
private void turnRight() {
turnLeft();
turnLeft();
turnLeft();
}
Anatomy of a Program
import stanford.karel.*;
public class OurKarelProgram extends Karel {
public void run() {
move();
pickBeeper();
move();
turnLeft();
This piece of the program's
move();
source code is called a
turnRight();
move();
method.
putBeeper();
move();
}
}
private void turnRight() {
turnLeft();
turnLeft();
turnLeft();
}
Anatomy of a Program
import stanford.karel.*;
public class OurKarelProgram extends Karel {
public void run() {
move();
pickBeeper();
move();
This line of code gives the
turnLeft();
name of the method
move();
(here, run)
turnRight();
move();
putBeeper();
move();
}
}
private void turnRight() {
turnLeft();
turnLeft();
turnLeft();
}
Anatomy of a Program
import stanford.karel.*;
public class OurKarelProgram extends Karel {
public void run() {
move();
pickBeeper();
move();
This line of code gives the
turnLeft();
name of the method
move();
(here, turnRight)
turnRight();
move();
putBeeper();
move();
}
}
private void turnRight() {
turnLeft();
turnLeft();
turnLeft();
}
Anatomy of a Program
import stanford.karel.*;
public class OurKarelProgram extends Karel {
public void run() {
move();
pickBeeper();
move();
turnLeft();
move();
turnRight(); This is called an import statement.
move();
It tells Java what Karel is.
putBeeper();
move();
}
}
private void turnRight() {
turnLeft();
turnLeft();
turnLeft();
}
Anatomy of a Program
import stanford.karel.*;
public class OurKarelProgram extends Karel {
public void run() {
move();
pickBeeper();
move();
This is called a
turnLeft();
code block
move();
turnRight();
move();
putBeeper();
move();
}
}
private void turnRight() {
turnLeft();
turnLeft();
turnLeft();
}
Method Definition
private void name() {
statements in the method body
}
Anatomy of a Program
import stanford.karel.*;
public class OurKarelProgram extends Karel {
public void run() {
move();
pickBeeper();
move();
}
move();
turnLeft();
turnRight();
move();
move();
putBeeper();
private void turnRight() {
turnLeft();
}
}
turnLeft();
turnLeft();
Place 100 beeper?
For Loop
for(int i = 0; i < N; i++) {
// to repeat N times
}
Review
for(int i = 0; i < N; i++) {
// to repeat N times
}
Work in Any World
Before
Before
After
After
Don’t Know World Size
?
© Copyright 2026 Paperzz