Random Number list help

For questions about using Classic.

Post » Wed May 14, 2014 10:26 pm

Hi all.
I have an issue, im strugling for months trying to make this work.

Every tick a random number is inserted on listbox1.
Every tick i need to check if the numbers on listbox2 appear between the numbers on listbox1 on the same order of listbox2 and when thats true, stop the number generation only after 10 more entries inserted on listbox1.

Is this possible?

Any help would be great. thanks. :P
B
2
Posts: 5
Reputation: 160

Post » Thu May 15, 2014 5:11 am

On every tick? I could be wrong but, that sounds like performance issue that would kill your game. Is the number constantly changing or is it an additional number be added? And if so, up to how many numbers?
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Thu May 15, 2014 3:47 pm

Its an app, not a game so perfomance is not an issue.
Numbers are being added to the list indefinitely and it only stops when the number list on listbox2 appears on listbox1, but i need it to stop only when 10 more numbers are added to listbox1. thanks.
B
2
Posts: 5
Reputation: 160

Post » Thu May 15, 2014 11:46 pm

The main tricky part is "on the same order of listbox2".

If I understand correctly you want:

Random numbers added to listbox1 every tick (60x a second).

Find the numbers from listbox2 inside of listbox1 (and if you consider order, it should be possible but is hard to explain)

After all numbers are found, wait until 10 additional numbers are generated to listbox1, then stop.

Is that correct?
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
124
S
42
G
17
Posts: 2,225
Reputation: 19,887

Post » Fri May 16, 2014 2:40 am

That is correct and its imperative that the numbers are detected in the same order and next to each other as listbox2.
Can we make it tick faster? Like 500x a sec.
I guess this is a kind of a challenge, its for testing something like "eternal recurrence".
Thanks.
B
2
Posts: 5
Reputation: 160

Post » Mon May 19, 2014 7:46 am

Well, the odds of them being in exact order and next to each other without any other numbers showing up is almost impossible to do faster than running the program for a long time (hours? days? years?). It sounds like you're trying to prove something like the Infinite Monkey Theorem: http://en.wikipedia.org/wiki/Infinite_monkey_theorem

Which, is a cool project :D

As for a tick, they usually occur 60x a second, but you might be able to get more random numbers per tick by using a for loop
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
124
S
42
G
17
Posts: 2,225
Reputation: 19,887

Post » Mon May 19, 2014 8:29 pm

Thanks for the for loop hint, i will try that.
B
2
Posts: 5
Reputation: 160

Post » Wed May 21, 2014 5:10 am

"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
124
S
42
G
17
Posts: 2,225
Reputation: 19,887

Post » Wed May 21, 2014 5:23 pm

Thanks Jayjay, that is exactly what i was looking for. You are the man. ;)
B
2
Posts: 5
Reputation: 160


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest