A player draws a a drawing on the screen (whiteboard). The goal is for him/her to write a program that enables a second player to replicate the exact same drawing by reading the program.
1) One player draws a drawing using basic geometric shapes on a coordinate system. 2) Without showing the drawing to the other player, he/she writes a program that allows anyone to replicate the drawing. 3) Once the program is written, the second player interprets it to recreate the original drawing.
When you want to draw a circle you call the 'drawCircle' function
But where on the screen will the program draw the circle?
What size will the program draw the circle?
To solve this problem, the function requires parameters.
Parameters specify where the function should draw the circle and what its size should be.
To achieve this, drawCircle function has three parameters: x, y and radius.
drawCircle(x, y, radius)
Example of function call:
drawCircle(5,6,3);
Let's practice!
Do not show your drawing to the other player!
Player 1 draws a drawing using basic geometric shapes on the 'draw your own' card with a coordinate system. If you don't have one download the coordinate system here.
Using blank tiles, create the function calls with parameters needed to replicate the drawing.
TIP: If tile is too small use big ones or use shorter names for function such as 'dTriangle' instead of 'drawTriangle'.
Using BEGIN, END, code blocks and the the blank tiles with the function calls you created, create the program to draw the plane.
The player that wrote the program shows it to the second player.
With the help of a pawn, starting at BEGIN, the second player interprets the code line by line and draws on the screen (whiteboard).
The game ends when the player that is interpreting the program finish calling all the functions and drawing the plane. Once finished, verify this drawing done from code with the original one..