Random Number list help

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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.

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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?

  • 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.

  • 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 <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    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

  • Thanks for the for loop hint, i will try that.

  • Is this what you wanted? <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> https://dl.dropboxusercontent.com/u/471 ... Finder.cap

  • Thanks Jayjay, that is exactly what i was looking for. You are the man.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)