I think `B>A` should be `B &lt; A`, but even better just make B = `randRange(A+1, 9)`