ADDing of numbers.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Yasin

I am creating a puzzle game related to addition /subtraction of numbers. In the game there will be random numbers (5,2,3,1,…).The player should select the correct answer from the answers (6,7,…).For example if the player selects the number 5 and 2, he should select the answer 7. If he chooses wrong answer he should be able to repeat the process again and choose the correct answer. How can I create a function like this for the game? Any suggestions.

:bust_in_silhouette: Reply From: Dooowy.

When the player selects 5, have a variable (Input_A) store 5, using an IF statement,
if( Input_A > 0 && InputDetected) then have (Input_B) store 2. now have another Function
Output = Input_A + Input_B. If you are completely new and this is your first project I advise you to read the Docs.

I attached a code to the numbers like and added a touch screen button

   $Label.text = str(number) 
   var B = int(str(number))
   print(B )

But it shows the selected number.When I click other number how can I make that number add to first selected number

Yasin | 2019-07-09 06:01