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!