4.4 Count dots on 5 black and white cards as one input (using a loop)

Block-based solution

View solution

This is just one of many possible solutions:

whenclickedsettotal number of dotsto0setindexto1setnumber of dotsto16askPlease enter 5 cards (B for black and W for white):andwaitsetcardstoanswerrepeat5ifletterindexofcards=Wthensettotal number of dotstototalnumberofdots+numberofdotssetnumber of dotstonumberofdots/2changeindexby1saytotalnumberofdots

Back to programming challenge