Random variables changing for no reason

I can't believe that that fixed it haha thanks man, I didn't even see that typo. I wish I could look at the machine language and figure out why that was causing issues. My guess is that "pNum" is stored in something like memory position 0x1, but when it tried to rewrite "bet[7]" to 0 which also had a theoretical memory position 0x1, it rewrote "pNum" to 0 instead.

Either way, the solution is solved! Thanks man. And thanks to everyone else that replied trying to help!!