The right card displayer robot

Action functions available :

pickCard(); picks one card from the deck and shows it
show('?'); '?' = 'hearts', 'diamonds', 'clubs' or 'spades'

Test functions available :

heartsCard () which returns true or false
diamondsCard () which returns true or false
clubsCard () which returns true or false

Window to edit your JavaScript code

Test your script

Résult of the execution of your code

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

The right card displayer robot

The goal of this exercice is to encount nested conditionals and learn how to use them.

The robot is able to pick up a deck of cards, pick a card, and show the card. It can also tell what suit the card is in: hearts, diamonds, clubs or spades.

The robot must pick a single card from the deck and show what card it is.

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