Re: TIB: "Weighting" Dice on TI-85


[Prev][Next][Index][Thread]

Re: TIB: "Weighting" Dice on TI-85




Jeremy Mullins wrote:
> 
> Notice the parenthesis?  There is a reason they are there.

Take a second glance, they don't change a thing.

>  There was one
> little thing wrong with it (the way I used it anyway), but I fixed that.
> 
> I used  the following
> :(int(rand*SIZE-WEIGHTF)+int(rand*WEIGHTF+WEIGHTF)+1)->RROLL
> :If RROLL>SIZE:Then:RROLL->SIZE:End:
> :If RROLL<1:Then:RROLL->0:End

Which boils down to:

int(rand*size)+int(rand*weight)-weight+wieght+1 [*]
= int(rand*size)+int(rand*weight)+1, cut highs to max.

This works, but if you want to be realistic about it, the weight should
be 0.000 (...) 000 something, and your average TI-85 wouldn't be
accurate enough to get anything out of this anyway. However, if you
scale up the numbers it might help...How would you ever know how much to
load the die? Why even bother?

[*] (why, again, do you bother to subtract and add the same thing, is it
because you can't see it?)

> WEIGHTF being the weight factor.  The higher it is the greater the weight
> differential. If it's 0, it all cancels down to the standard
> (int(rand*SIZE))+1.  It starts producing a lot of the highest values if the
> WEIGHTF variable approaches too close to the RROLL variable (or 1's if
> WEIGHTF is too close, but opposite), but it works pretty well as long as
> WEIGHTF is a reasonable value.  I have some more code in the program that
> works it in so that the user can enter a percentage and it will act
> similarly with any size die.  Try it out.  It works.

Yes, but I have no idea for what purpose. Simulating real dice-throws is
rather ambitious when you haven't the slightest idea of how to do it.
Who knows, you might be unfairly favouring the people who use your
program, for those who use dice.

[snip]

-- 
          Rene Kragh Pedersen
------------------------------------------------------------------
man: Why did you get a divorce?
man:: Too many arguments.


References: