Objectives
Work Log
Use conditional statements to control the flow of your programs. Create a sketch that asks people to make difficult choices that have surprising consequences.
- Which choices are easier, harder? Which choices are false choices?
- What internal or external factors influence the choice? How do others’ choices affect your choices?
- What choices surprise you with unexpected outcomes?
- Can you combine choices to create hard-to-predict results? (Hint: Use && and ||)
- Work in Pairs Can you divide an idea into two parts and combine those parts? (e.g. One of you codes the input behaviors (if statement) and the other one codes the output behaviors (what to do if it’s true.) Can you swap sketches and riff off of your partner's work? Provide 1 sketch link per pair, however clearly describe who did what in the code.
building the central logic
We needed a ‘storyline’ of this little game. Since Chris and I both share a passion in spreadsheets, we communicated through this tool. After some discussion, we agreed on the overall storyline and options/choices to make.
Building the code logic
choice
variable indicating which of the options were selected to be initialized at each query, and a qnum
variable to mark which query the user is at.state
variable - if you stay alive you continue on to the next query; otherwise you escape the cascade.
Learning Materials
Questions
var
and using/updating later on vs declaring with let
and initializing in setup
using/updating later on