And trying to mix that code with mine can't do anything but produce a total mess.
What's the bit with the "bet multipliers"? That's not poker. I think what you found was a simulation of one of those poker SLOT MACHINES!
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.