Boğaziçi Ünv. 2015 Koç Ünv. 2016 Darüşşafaka Lisesi. 2014
Asena Bryce Julia
Nick Chris Lisa
Great team!... Some of them were in your place just 2 years ago
Pelin
Stanford? Language Call me Tyler I grew up in Arizona. Played a lot of soccer growing up. Really liked math/science.
Stanford I’m a graduate student in Electrical Engineering at Stanford How much experience did I have when I first did this material? It was difficult for me too. Started teaching in section leading program. Now I coordinate that program. We want all of you to be successful That’s why we have such a large course staff But over years and years and years we have been working on our material so that everyone gets through… Not competing against anyone but yourself. Everyone can win!
Logistics Schedule is fluid Explain purpose of lab/section. Learn by doing!!
Prerequisites Just need to know how to turn on a computer and ask for help. We love questions!!!
Course Website http://csbridge.org *note that its org not com Link to sign into lab *note that its org not com
Very High Level We will teach some specific things (Java syntax, Karel commands) but more importantly… We teach software engineering principles. Much larger than just programming. Mechanics of the language are nothing compared to the principles. You are going to learn the principles by programming in Java
Breakout demo!
Breakout Breakout demo!
What if I fall behind? First, it is okay! Everyone learns at a different pace. Ask for help.
Share Ideas Not Code
Karel Speaks Java s Karel is a gentle introduction to programming
Karel’s World North West East South 3 + + + + + 2 + + + + + 1 + + + + 4 5
Knows Four Commands move(); turnLeft(); putBeeper(); pickBeeper();
Walls + 1 2 3 4
Beepers + 1 2 3 4
move();
move(); + 1 2 3 4
move(); + 1 2 3 4 +
turnLeft();
turnLeft(); + 1 2 3 4 +
turnLeft(); + 1 2 3 4 +
pickBeeper();
pickBeeper(); + 1 2 3 4 +
pickBeeper(); + 1 2 3 4 +
Questions?
First Challenge + 1 2 3 4
First Challenge + 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(); turnLeft(); turnRight(); putBeeper(); } private void turnRight() {
This is the program's source code Anatomy of a Program import stanford.karel.*; public class OurKarelProgram extends Karel { public void run() { move(); pickBeeper(); turnLeft(); turnRight(); putBeeper(); } private void turnRight() { This is the program's source code
This piece of the program's source code is called a method. Anatomy of a Program import stanford.karel.*; public class OurKarelProgram extends Karel { public void run() { move(); pickBeeper(); turnLeft(); turnRight(); putBeeper(); } private void turnRight() { This piece of the program's source code is called a method.
This line of code gives the name of the method Anatomy of a Program import stanford.karel.*; public class OurKarelProgram extends Karel { public void run() { move(); pickBeeper(); turnLeft(); turnRight(); putBeeper(); } private void turnRight() { This line of code gives the name of the method (here, run)
This line of code gives the name of the method Anatomy of a Program import stanford.karel.*; public class OurKarelProgram extends Karel { public void run() { move(); pickBeeper(); turnLeft(); turnRight(); putBeeper(); } private void turnRight() { This line of code gives the name of the method (here, turnRight)
This is called an import statement. It tells Java what Karel is. Anatomy of a Program import stanford.karel.*; public class OurKarelProgram extends Karel { public void run() { move(); pickBeeper(); turnLeft(); turnRight(); putBeeper(); } private void turnRight() { This is called an import statement. It tells Java what Karel is.
This is called a code block Anatomy of a Program import stanford.karel.*; public class OurKarelProgram extends Karel { public void run() { move(); pickBeeper(); turnLeft(); turnRight(); putBeeper(); } private void turnRight() { This is called a code block Talk about indentation
This adds a new command to Karels vocabulary Method Definition private void name() { statements in the method body } This adds a new command to Karels vocabulary
Anatomy of a Program import stanford.karel.*; public class OurKarelProgram extends Karel { public void run() { move(); pickBeeper(); turnLeft(); turnRight(); putBeeper(); } private void turnRight() { Talk about indentation
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 After Before After What will I learn next time?
Don’t Know World Size ?