![]() |
|
#1
|
|||
|
|||
|
okay so I've been trying to figure out how to do this for a little while now and I figure you might be able to help
I'm trying to make a simple dice game that I and my fiance enjoy playing for the PSP. My problem is that I need the code to recognize if multiple dice have the same value, and if so the player is awarded extra points. The awarding of points is easy, however I cannot for the life of me think of an efficient way to tell the program to check if 3 of the 5 dice have the same value... for instance: if the player rolls 3 sixes he/she gains 600 points if the player rolls 3 ones he/she gains 1000 points I'm assigning values as such: Dice={} Dice[1]={RollValue=0} Dice[2]={RollValue=0} Dice[3]={RollValue=0} Dice[4]={RollValue=0} Dice[5]={RollValue=0} for a=1,5 do Dice[a].RollValue=math.random(1,6) end This is only an exert of the whole code, however, you get the gist. I currently have the code recognizing the values of single dice and assigning points according to that. Any help would be appreciated. |
|
|
|||
|
|||
|
|
| Thread Tools | |
| Display Modes | |
|
|