a little math/logic help

Blitz3D Forums/Blitz3D Beginners Area/a little math/logic help

sorry i posted this in the codearchives. but I realized it was the wrong place too late. does someone know what is going wrong with this: http://www.blitzbasic.com/codearcs/codearcs.php?code=2406