# How do I make random 16 digit number?

Just started using Construct 2? Post your questions here

### » Sun Jul 27, 2014 2:12 pm

~Everyone can make GAMEs~
B
64
S
12
G
1
Posts: 418
Reputation: 6,126

### » Sun Jul 27, 2014 2:54 pm

The quicker way I can think right now is something like that:

number = ""

for i = 1 to 16
number = number & str(int(random(10))
next

This gives you a 16 digits string from 0 to 9.
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
32
S
13
G
4
Posts: 141
Reputation: 4,882

### » Sun Jul 27, 2014 5:21 pm

what that mean "for i " ??
~Everyone can make GAMEs~
B
64
S
12
G
1
Posts: 418
Reputation: 6,126

### » Sun Jul 27, 2014 5:36 pm

Hardty wrote:what that mean "for i " ??

It is the classic way of representing a loop,
It is the for loop in C2 that you will use in your case, you can also just use a repeat 16 times loop.

Also you will have, before running the loop, to set number to "".
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
23
G
18
Posts: 2,123
Reputation: 17,200

### » Sun Jul 27, 2014 5:40 pm

Jeff Skyrunner wrote:The quicker way I can think right now is something like that:

number = ""

for i = 1 to 16
number = number & str(int(random(10))
next

This gives you a 16 digits string from 0 to 9.

Thankss That's Work!

Aphrodite wrote:
Hardty wrote:what that mean "for i " ??

It is the classic way of representing a loop,
It is the for loop in C2 that you will use in your case, you can also just use a repeat 16 times loop.

Also you will have, before running the loop, to set number to "".

~Everyone can make GAMEs~
B
64
S
12
G
1
Posts: 418
Reputation: 6,126