Hi,

I'm trying to come up with a way to generate a pseudo-random sequence of integers that meet the following conditions:

 - there are n integers in the sequence
 - the sum of the integers in the sequence is x
 - the value of each integer in the sequence is between 1 and 6, inclusive

Basically, I'm trying to create a game in which users roll a die and move their piece along a game board, but arranging things so that on the last turn they reach the "finish" space exactly. (It's all for fun, so there are no ethical concerns about "rigging.")

There are a few times during the game where the number of turns remaining might increase by one, so I have to be able to recalculate the sequence on the fly based on the player's current board position. I suppose I'll also have to make sure the player doesnt' get too close to the finish space on the penultimate turn, in case an extra turn needs to be added.

If anyone has any ideas, I'd be most appreciative!

Thanks in advance,
Jim
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to