דלג לתוכן

Lesson 25: Find the door

English

Look before you move

  • The robot is in a dark room. It cannot see the door, but it can measure.
  • A wall is close, so the distance is short. Through the door the distance is long, to the wall far outside.
  • The robot looks in 4 directions, keeps the 4 distances in a list, and chooses the longest.

Words for this lesson

Word Meaning
max the biggest value: max([3, 9, 4]) is 9
index the position of a value in a list, from 0
heading the direction the robot faces: 0, 90, 180 or 270

היכנס או צור חשבון

IGCSE, A-Level & AP