At 1:58 AM -0500 7/19/06, ryanm wrote:
- 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
There are a couple of things that I'm not following.
1. Does the board have a static number of spaces?
Yes (25 in this case).
2. Are there a set number of turns, or can it take as long as it takes?
There are a minimum of 7 turns, and a maximum of 9. Each turn
consists of a roll, a move on the board, and a question for the
player to answer. If a player answers all questions correctly, the
game must consist of exactly 7 turns. If they get one or two wrong,
one or two turns need to be added so they can still achieve a perfect
winning score. If they get more than two wrong, they can't get the
perfect score (we have only 9 questions to work with, so the game
can't be extended beyond that).
3. Why do you need to know all of the rolls in advance, can't you
just make your "roll" function ensure that the last roll is always
exactly the right number of spaces?
I don't need to know the rolls in advance, but the player has to be
able to reach the end on the last roll. Given 7 turns, 25 spaces and
a six-sided die, if a random-only solution produced [1,3,4,2,1,2] for
the first six rolls, it would be impossible to reach the end space on
the seventh roll.
I figure the best way to do this is generate the roll sequence based
on where they are, examine it to make sure they can reach, adjust it
if necessary, and redo the whole thing if the number of turns changes.
-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