Hello,

I was looking in tutorials and in forum but there was no joy, so question how do you create random math formula like this to display in a game: 5+5=10, 5*5=25 .... etc, my game will be math calculating game.

Regards,

Aurimas

10 posts
• Page **1** of **1**

Edit: ignore, misread the OP sorry

Note you don't really want 'every tick', I used that as a 'placholder' event. The above will add 5 to MyVar about 60 times a second

Edit:

This is probably where you should start in the manual https://www.scirra.com/manual/83/variables

And also the word 'random' has many connotations, maybe 'arbitrary' would be better. Also you'll see references to 'expressions' in the manual which is what you meant by 'formula'. Good luck

Local number MyVar = 0

System:Every Tick -> System: Add 5 to MyVar

Note you don't really want 'every tick', I used that as a 'placholder' event. The above will add 5 to MyVar about 60 times a second

Edit:

This is probably where you should start in the manual https://www.scirra.com/manual/83/variables

And also the word 'random' has many connotations, maybe 'arbitrary' would be better. Also you'll see references to 'expressions' in the manual which is what you meant by 'formula'. Good luck

Last edited by codah on Thu Aug 28, 2014 8:42 am, edited 1 time in total.

**Posts:**1,646**Reputation:**6,596

B

24
S

9
G

4
floor(random(0,10))&choose("+","-","*","etc")&floor(random(0,10))

foor is whole numbers

random is 0 to 10

choose is select either of the given options

Better to store each in variable

number1 = floor(random(0,10))

formula = choose....

number2 = floor(......

Then calculate as integar to give answer.... can't calculate text

foor is whole numbers

random is 0 to 10

choose is select either of the given options

Better to store each in variable

number1 = floor(random(0,10))

formula = choose....

number2 = floor(......

Then calculate as integar to give answer.... can't calculate text

**Posts:**1,429**Reputation:**12,708

B

65
S

16
G

9
**Posts:**69**Reputation:**950

B

14
S

3
G

1
**Posts:**1,646**Reputation:**6,596

B

24
S

9
G

4
@Aurimas

Here's a simple example of a basic math quiz.

Logic is basically the same as LittleStain posted in the link roteam shared.

Here's a simple example of a basic math quiz.

Logic is basically the same as LittleStain posted in the link roteam shared.

You do not have the required permissions to view the files attached to this post.

Vote for all the Construct 2 games on Steam Greenlight - Find them here

**Posts:**444**Reputation:**6,731

B

32
S

9
G

7
10 posts
• Page **1** of **1**