6.S095 | January IAP 2018 | Undergraduate

Programming for the Puzzled

Puzzle 1: You Will All Conform

While individuality is important, conformity has its merits too. Your job is to get a queue of people waiting to enter a stadium to orient their caps the same way. In this video, Prof. Devadas describes how you can do this with the fewest requests.

Puzzle Description

Python Code

Assignment

  • Do one or more of the exercises in the You Will All Conform puzzle.

Solution

Programming Constructs and Algorithmic Paradigms Covered in this Puzzle

  • Lists
  • Tuples
  • Functions
  • Control flow including if statements and for loops
  • Print statements

Course Info

Instructor
As Taught In
January IAP 2018
Learning Resource Types
Lecture Videos
Programming Assignments with Examples