STORY PLAY STORE

Learn to Code through Gameplay

2

Write your first programs

Video Example:

Material required: Download material .pdf

Whiteboard and marker
Whiteboard and marker
Drawing cards with geometric shapes
Drawing cards with geometric shapes
Code block
Code blocks
Function calls for drawing geometric shapes
Function calls for drawing geometric shapes
program BEGIN block
BEGIN block
program END block
END block

   Play        Write

1

What should my programs do?

Your programs should draw on the whiteboard.

2

How do I start?

1

A program begins with a BEGIN block and ends with an END block.
Place the blocks as follows:

Program structure: BEGIN block, code blocks, END block
2

Choose a drawing tile from those available on the first pages of this manual. For example: "a locomotive". Then, decompose the drawing: "What shapes can we decompose the drawing into?".

Example: The cabin is a rectangle, the wheels are circles, etc.

Decomposed locomotive drawing into basic geometric figures
3

How do I write my program?

Fill in the code blocks with function calls to draw geometric shapes so that, when the program is executed, it draws 'a locomotive':

Program that draws a locomotive using block programming
4

How do I run my program?

1

Position yourself on the BEGIN block to start executing your program and follow the arrows.

BEGIN block in a program done with block programming
2

Execute the instructions of each code block in order and draw the geometric shapes on the whiteboard:

Execution of the 'draw locomotive' program
3

The END block marks the end of the program..

END block in a program done with block programming
5
You know how to do it! Now choose other drawings and create more programs.

C-max AI tutor wandering

Where can I find more ideas to create more programs?

1

Choose other drawings and create programs to draw them on the whiteboard.

Drawing cards: a bird, a locomotive, a girls, a house, a boat, a car, a robot and an owl
2

Choose an object from your house or one you find in a book and create a program to draw the object on the whiteboard.

Flexo and cactus
3

You can use all available function calls.

Function calls to draw geometric figures
C-max AI Code Tutor smiling

What have I learned?

You have learned to write, read, and execute a program.

Puzzles:

Write 1

4+ years
Using blocks, create a program that draws a 'bird':
Empty program that needs to be completed to draw a bird
Show answer

Answer:

Program capable of drawing a bird

Debug  2

4+ years
Desperate developer because of a bug - What a disaster! My program draws a girl with a triangle on her head instead of hair! Help me find and correct the error.
Bugging program that draws a girl
Show answer

Answer:

Bug fixed in program that draws a girl

Read  3

5+ years
What drawing does the following program create?
Program and possible outputs
Show answer

Answer:

Program output: drawing of a girl

Read  4

8+ years
What drawing does the following program create?
Program possible outputs
Show answer

Answer:

Program output: House drawing

Write 5

8+ years
Write code that creates the following 'bird', click the 'TEST CODE' button to test your code:
TEST CODE ▷
Bird drawn with basic geometrical shapes
Show answer

Answer:


Debug6

9+ years
Locomotive drawing done with basic geometrical shapes Thinking developer because of a bug
- Oops! I can't get my program to draw a locomotive. Please find the error and correct it.
TEST CODE ▷
Show answer

Answer:


WOW! If you've made it this far, congratulations:

You know how to read, write, and debug code.

That's programming!