CSC111 Games around Functions
--D. Thiebaut 09:47, 20 October 2011 (EDT)
Each game below can be played in class just to get the idea of what goes on. Think of the game as a play. Students are actors and have lines to say. When the director points to an actor, the actor says her line. Once a game is played in class and fully understood, translate it into python, using functions.
Game 1
- Student 1
- Say "Banana!"
- Student 2
- Say "Orange!"
- Student 3
- Say "Peanut Butter!"
- Main
- Call Student1
- Call Student2
- Call Student3
Game 2
* Student 1
- Say "Banana!"
- Student 2
- Say "Orange!"
- Student 3
- Say "Peanut Butter!"
- Main
- repeat 3 times:
- Call Student1
- Call Student2
- repeat 2 times:
- Call Student3
- repeat 3 times:
Game 3
- Student 1
- Say "Caramba!"
- Student 2
- Say "No, No, No!"
- Student 3
- Call Student 1
- Say "Si!"
- Main
- Call Student 2
- Call Student 1
- Call Student 3
Game 4
- Student 1 ( sentence )
- Get sentence
- Say the sentence
- Student 2 ( sentence )
- Get sentence
- Say "My T-Shirt says: "
- Say the sentence
- Student 3 ( sentence )
- Get sentence
- Say "And now listen to this: "
- Call student 1 and pass her sentence
- Main
- Call Student 1 and pass "I am tired"
- Call Student 2 and pass "I live for Chocolate"
- Call Student 3 and pass "Almost Spring Break!"
Game 5
- Student 1 ( sentence1, sentence2 )
- Get sentence1 and sentence2
- ask Student2 to say sentence1
- ask Student3 to say sentence2
- Student 2 (sentence )
- get sentence
- Say "Hear this:" and then say sentence
- Student 3 (sentence )
- get sentence
- Say "The news is: " and then say sentence
- main
- Call Student 1 and pass "Spring Break in two weeks!", and "Exam in a week and a half"