4.3 Count dots on 5 black and white cards as one input (without a loop)

Block-based solution

View solution

This is just one of many possible solutions:

whenclickedsettotal number of dotsto0askPlease enter 5 cards ('B' for black and 'W' for white):andwaitsetcardstoanswerifletter1ofcards=Wthensettotal number of dotstototalnumberofdots+16ifletter2ofcards=Wthensettotal number of dotstototalnumberofdots+8ifletter3ofcards=Wthensettotal number of dotstototalnumberofdots+4ifletter4ofcards=Wthensettotal number of dotstototalnumberofdots+2ifletter5ofcards=Wthensettotal number of dotstototalnumberofdots+1saytotalnumberofdots

Back to programming challenge