How do you make a text box when focused take in the value of 6 images and do the math necessary?

I am making a Yahtzee game and need to make a text box that when clicked takes the values of the dice/images set in a dictionary and do the necessary math. Can anyone help?



1- you need to know the Yahtzee rules. See Yahtzee - Wikipedia

2- Use the if Blocks to roll dice. Use the random Block to throw the dice with a value of 1 to 6

3- Use the Math Blocks to total the rolls of six dice.

4- in this case it might be easier to use a List to keep track of the rolls. After each roll, add the value associated with the roll to the preceding roll. After six rolls, total the values in the List.

5- you can make this easier to display the dice by naming the dice 1.jpg, 2.jpg etc. You can use a HorizontalLayout with six Image controls, or a Table etc. to display the dice rolls.

6- No need to provide a TextBox that is focused. There are better ways to handle the Math.

7- etc.. etc.

8- Search the MIT Gallery for severa; examples showing how others created the game by searching the Gallery for Yahtzee. This link might work MIT App Inventor Gallery

Here is one example MIT App Inventor Gallery

Good luck. :slight_smile: