Week 7: Feb 18-22
Algorithms, flowcharts, and sub-routines- Coding with Python- Night in the Museum game
Learning objectives:
- Select and use appropriate comparison operators in algorithms, limited to <,>, <=, >=, == (equal to) and != (not equal to).
- Predict the outcome of flowcharts that use selection.
- Understand and use selection statements, limited to IF, THEN, ELSE, presented as flowcharts.
For drawing an accurate flowchart use the following checklist :
- it must always have a start and a stop
- all inputs and outputs must be in a parallelogram
- all processes must be in a rectangle
- a selection must only have true/yes or false/no as answers
- a selection must be in a diamond
- all boxes apart from selection should have one arrow going in, and one arrow going out
- selection must have two arrows going out, labelled as true/yes and false/no
- every box must join to another box
- data flows must have arrows to show which way to work through the flowchart.
Game images:
Game code:
To add a game title:
To define and name Coin, Mummy, background and score:
def draw(): function:
def update (): function: