T1 Worksheet 1
T1 Worksheet 1
Task 1
1. Qwerty is a small island in the southern
hemisphere.
The Qwertian people have two types of people.
The ASCIIs who always say the truth and the
UNICODEs who always lie.
There are three people (A, B and C) in a
Qwertian coffee shop.
1
Worksheet 1
Decomposition and abstraction
Unit 1 Computational thinking
You need to fill the 5-litre jug with exactly 4 litres of water.
Write an algorithm to solve this problem
2
Worksheet 1
Decomposition and abstraction
Unit 1 Computational thinking
3
Worksheet 1
Decomposition and abstraction
Unit 1 Computational thinking
Task 2
1. ‘Beetle’ is a dice game for two or more players, played with a single six-sided die.
The objective is to be the first to draw all parts of a beetle. At each turn, a player rolls the
die to decide which part can be drawn.
The body has to be drawn first, by throwing a 6. Head, legs and tail can then be drawn
when the correct value is shown on the die.
Eyes and antennae cannot be drawn until the head is drawn.
The first person to draw all the body parts is the winner.
Throw Part Count
Six Body 1
Five Head 1
Four Tail 1
Three Leg 4
Two Antenna 2
One Eye 2
You need to write a program to allow a player to play Beetle against the computer.
(a) Decompose this game into component parts using a structure diagram.
(b) Which sub-problems, if any, could be reused if you are asked to write a program for a
different dice game?
4
Worksheet 1
Decomposition and abstraction
Unit 1 Computational thinking
Task 3
Find an Internet site that simulates playing a simple dice game, and decompose the steps in the
algorithm used to program the game.
e.g. http://www.playonlinedicegames.com/
Draw a structure diagram which shows how the game is decomposed.
5
Worksheet 1
Decomposition and abstraction
Unit 1 Computational thinking
Task 4
A 3D computer game allows players to interact with a house.
(a) List at least five details that have been removed from the house by abstraction.
(b) Give five possible subprograms (functions or procedures) that may be used within the
game.