Bo azii nv. 2015 Dar afaka Lisesi. 2014 Ko nv. 2016 Ko nv. 2017 - - PowerPoint PPT Presentation

bo azi i nv 2015 dar afaka lisesi 2014 ko nv 2016 ko nv
SMART_READER_LITE
LIVE PREVIEW

Bo azii nv. 2015 Dar afaka Lisesi. 2014 Ko nv. 2016 Ko nv. 2017 - - PowerPoint PPT Presentation

Bo azii nv. 2015 Dar afaka Lisesi. 2014 Ko nv. 2016 Ko nv. 2017 Asena Bryce Julia Nick Chris Lisa Great team! Pelin Bar


slide-1
SLIDE 1
slide-2
SLIDE 2

Boğaziçi Ünv. 2015 Darüşşafaka

  • Lisesi. 2014

Koç Ünv. 2016 Koç Ünv. 2017

slide-3
SLIDE 3

Asena Bryce Julia

slide-4
SLIDE 4

Nick Chris Lisa

slide-5
SLIDE 5

Great team!

slide-6
SLIDE 6

Pelin Barış Yazar

slide-7
SLIDE 7

Logistics

slide-8
SLIDE 8

Stanford?

slide-9
SLIDE 9

Stanford

slide-10
SLIDE 10

Prerequisites

slide-11
SLIDE 11

http://koc.csbridge.org Course Website

*note that its org not com

slide-12
SLIDE 12

Very High Level

slide-13
SLIDE 13
slide-14
SLIDE 14

Breakout

slide-15
SLIDE 15

What if I fall behind?

slide-16
SLIDE 16

Share Ideas Not Code

slide-17
SLIDE 17

s

Karel Speaks Java

slide-18
SLIDE 18

+ + + + + + + + + + + + + + + 1 2 3 1 2 3 4 5

North South West East

Karel’s World

slide-19
SLIDE 19

Knows Four Commands move(); turnLeft(); putBeeper(); pickBeeper();

slide-20
SLIDE 20

+ + + + + + + + + + + + 1 2 3 1 2 3 4

Walls

slide-21
SLIDE 21

Beepers

+ + + + + + + + + + + + 1 2 3 1 2 3 4

slide-22
SLIDE 22

move();

slide-23
SLIDE 23

move();

+ + + + + + + + + + + + 1 2 3 1 2 3 4

slide-24
SLIDE 24

move();

+ + + + + + + + + + + + 1 2 3 1 2 3 4 +

slide-25
SLIDE 25

turnLeft();

slide-26
SLIDE 26

turnLeft();

+ + + + + + + + + + + + 1 2 3 1 2 3 4 +

slide-27
SLIDE 27

turnLeft();

+ + + + + + + + + + + + 1 2 3 1 2 3 4 +

slide-28
SLIDE 28

pickBeeper();

slide-29
SLIDE 29

pickBeeper();

+ + + + + + + + + + + + 1 2 3 1 2 3 4 +

slide-30
SLIDE 30

pickBeeper();

+ + + + + + + + + + + + 1 2 3 1 2 3 4 +

slide-31
SLIDE 31

Questions?

slide-32
SLIDE 32

+ + + + + + + + + + + + 1 2 3 1 2 3 4

First Challenge

slide-33
SLIDE 33

+ + + + + + + + + + + + 1 2 3 1 2 3 4

First Challenge

slide-34
SLIDE 34

Need a Volunteer

slide-35
SLIDE 35

Lets Try It

slide-36
SLIDE 36

Program Style

slide-37
SLIDE 37

Questions?

slide-38
SLIDE 38

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

slide-39
SLIDE 39

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

This is the program's source code

slide-40
SLIDE 40

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(); } } This piece of the program's source code is called a method.

Anatomy of a Program

slide-41
SLIDE 41

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

This line of code gives the name of the method (here, run)

slide-42
SLIDE 42

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

This line of code gives the name of the method (here, turnRight)

slide-43
SLIDE 43

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

This is called an import statement. It tells Java what Karel is.

slide-44
SLIDE 44

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

This is called a code block

slide-45
SLIDE 45

Method Definition

private void name() { statements in the method body }

slide-46
SLIDE 46

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(); } }

Program Style

slide-47
SLIDE 47

Place 100 beeper?

slide-48
SLIDE 48

For Loop

for(int i = 0; i < N; i++) { // to repeat N times }

slide-49
SLIDE 49

Review

for(int i = 0; i < N; i++) { // to repeat N times }

slide-50
SLIDE 50

Before After Before After

Work in Any World

slide-51
SLIDE 51

Don’t Know World Size

?