Number Pool object?

For questions about using Classic.

Post » Mon Mar 16, 2009 1:43 am

Before I go ahead and use a dynamic array instead, is there a number pool object or function in Construct.

Nothing found on the search here, or on the wiki as far as I could tell.

For those not familiar with it, it allows a range of numbers to be stored, which can then be retrieved at random without repetition.
The card game object probably uses the same sort of number pool to stop duplicate cards appearing (I've looked at the Card Game object to see if I could utilise that, but it's not suitable for what I want).

Cheers.
B
2
S
1
G
3
Posts: 105
Reputation: 1,310

Post » Mon Mar 16, 2009 1:54 am

I'd just use a For loop to add the numbers you want to a listbox, then use a random call to get a line, and then delete it.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Mon Mar 16, 2009 2:01 am

I was going to use an array, but using a listbox will save me having to manually shift the numbers down the array and shorten the range each time.

Nice one!

:D
B
2
S
1
G
3
Posts: 105
Reputation: 1,310


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests