The tossing coin robot

Action functions available :

tossCoin(); the robot toss a coin and catch it
show('side'); where 'side' = 'tails' or 'heads'

Test function available :

tailsSide() returns true or false

Window to edit your JavaScript code

Test your script

Résult of the execution of your code

Notice: the two executions of your program must be correct without changing your code between them.

The tossing coin robot

The goal of this exercise is to understand the simple conditional structure and how to use it.

The robot have to toss a coin, catch it and show whether it's heads or tails.

Use the test function to show the right side of the catched coin.

To make your task easier, you can « copy/paste » from the list of functions found on the top of this exercise.

Good work.

◊ ◊ ◊

© Rupert Meurice de Dormale 2017

All rights reserved, reproduction in whole or in part of the interface and / or the code forbidden without the written agreement of the author

The drawings of the robots are of Jean-Baptiste Sonnet.

adresse