I am making a game with a possible 3,838,380 spells. I want to generate them all.
You have 40 ingredients to choose from.
It takes 6 ingredients to make a spell.
That's 3,838,380 spells.
I need the spells to be the same every game.
So I need a seed. I need to know that all of the spells can be made.
So I generate the spells with a spell editor. What do I do after I generate the spells?
Do I store them all? Would that take up a lot of HD space?
Would storing them all take ages to load them all?
I don't want people to be able to look at the spells, they are secret to the game. Looking at the spells would give the player an advantage.
I could generate them during the game if I knew how to seed 3,838,380 results without any missing patterns.
A Lottery generator looks a bit like this...
Dim Array(7)
REM THIS PART MAKES A LIST OF ALL 7 NUMBER SEQUENCES
for n = 1 to 43
for n2 = n+1 to 44
for n3 = n2+1 to 45
for n4 = n3+1 to 46
for n5 = n4+1 to 47
for n6 = n5+1 to 48
for n7 = n6+1 to 49
Number$ = str$(n) + ","
Number$ = Number$ + str$(n2) + ","
Number$ = Number$ + str$(n3) + ","
Number$ = Number$ + str$(n4) + ","
Number$ = Number$ + str$(n5) + ","
Number$ = Number$ + str$(n6) + ","
Number$ = Number$ + str$(n7)
REM THIS PART TAKES THE 7 NUMBERS AND CREATES THE PERMUTATIONS
for i1 = 1 to 7
for i2 = 1 to 7
if i2 <> i1
for i3 = 1 to 7
if i3 <> i1 and i3 <> i2
for i4 = 1 to 7
if i4 <> i1 and i4 <> i2 and i4 <> i3
for i5 = 1 to 7
if i5 <> i1 and i5 <> i2 and i5 <> i3 and i5 <> i4
for i6 = 1 to 7
if i6 <> i1 and i6 <> i2 and i6 <> i3 and i6 <> i4 and i6 <> i5
for i7 = 1 to 7
if i7 <> i1 and i7 <> i2 and i7 <> i3 and i7 <> i4 and i7 <> i5 and i7 <> i6
REM YOUR NUMBERS ARE SORTED IN HERE....PUT THEM IN THE ARRAY, AND COMPARE THEM TO THE LOTTO.
Next i7
end if
Next i6
endif
Next i5
end if
Next i4
end if
next i3
end if
next i2
next i1
next n7
next n6
next n5
next n4
next n3
next n2
next n1
I don't want any 2 spells to be the same...Any ideas?