blueroomelectronics
Well-Known Member
I'm doing a dice program using a freerunning timer that automatically and fairly counts from 0-6^x (where x is number of die)
Now one die is easy (I'm a BASIC programmer but want to do it in C18)
So
A single die is roll+1
Two dice are D1=int(roll/6)+1 and D2=(roll mod 6)+1
Any ideas on 3 or more dice? And avoiding floating point...
Now one die is easy (I'm a BASIC programmer but want to do it in C18)
So
A single die is roll+1
Two dice are D1=int(roll/6)+1 and D2=(roll mod 6)+1
Any ideas on 3 or more dice? And avoiding floating point...