Good catch.  I felt uncomfortable building this without unit testing. 
It should be possible to write good repeatable tests using srand in
place of rand...


> > Conveniently, ** has the desired
> > precedence relative to the other operators, plus it is binary and
> > left-associative.  This feels so evil.  Seduced by the Dark Side I am.
> >
>
>
> I used the same approach, but found that ** is right-associative (as
> it's generally defined outside of Ruby).  To confirm the
> associativity for yourself, try this: 2**3**4.  If it's left
> associative, it should equal 8**4 (4096), right-associativity gives
> 2**81 (a lot).  I ended up doing a lot more redefining and mucking
> about:
>