Difference between revisions of "CSC111 Games around Functions"

From dftwiki3
Jump to: navigation, search
(Game 2)
Line 9: Line 9:
 
<br />
 
<br />
 
=Game 1=
 
=Game 1=
 
+
<br />
 
* Student 1
 
* Student 1
 
** Say "Banana!"
 
** Say "Banana!"
Line 28: Line 28:
 
<br />
 
<br />
 
<br />
 
<br />
 
+
<br />
 
=Game 2=
 
=Game 2=
 
+
<br />
* Student 1
+
<br />* Student 1
 
** Say "Banana!"
 
** Say "Banana!"
  
Line 47: Line 47:
 
*** Call Student3
 
*** Call Student3
 
<br />
 
<br />
 
+
<br />
 +
<br />
 +
<br />
 +
<br />
 
=Game 3=
 
=Game 3=
 
+
<br />
 
* Student 1
 
* Student 1
 
** Say "Caramba!"
 
** Say "Caramba!"
Line 64: Line 67:
 
** Call Student 1
 
** Call Student 1
 
** Call Student 3
 
** Call Student 3
 
+
<br />
 +
<br />
 +
<br />
 +
<br />
 
=Game 4=
 
=Game 4=
 
+
<br />
 
* Student 1 ( sentence )
 
* Student 1 ( sentence )
 
** Get sentence
 
** Get sentence
Line 85: Line 91:
 
** Call Student 2 and pass "I live for Chocolate"
 
** Call Student 2 and pass "I live for Chocolate"
 
** Call Student 3 and pass "We have no labs on November 10!"  
 
** Call Student 3 and pass "We have no labs on November 10!"  
 
+
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 
=Game 5=
 
=Game 5=
 
+
<br />
 
* Student 1 ( sentence )
 
* Student 1 ( sentence )
 
** Get sentence
 
** Get sentence
Line 106: Line 116:
 
* main
 
* main
 
** Call Student 3 and pass "Caramba!"
 
** Call Student 3 and pass "Caramba!"
 
+
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 
<br />
 
<br />
 
<br />
 
<br />
 
[[Category:CSC111]][[Category:Python]][[Category:Exercises]]
 
[[Category:CSC111]][[Category:Python]][[Category:Exercises]]

Revision as of 09:38, 3 March 2014

--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






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 "We have no labs on November 10!"






Game 5


  • Student 1 ( sentence )
    • Get sentence
    • Say "My T-shirt says"
    • Say sentence
  • Student 2 (sentence1, sentence 2 )
    • get sentence 1
    • get sentence 2
    • Say sentence 1
    • Call Student 1 and pass sentence 2
    • Say "Thank you!"
  • Student 3 (sentence 3 )
    • get sentence 3
    • call student 2 and pass sentence3, and "Hello"
  • main
    • Call Student 3 and pass "Caramba!"