One card game called doubling pigs.

The codes described two different strategies in doubling pigs. One is hold_at_20, which is "Hold at 20 pending. Always accept; Never double." Another is the strategy I provided. This strategy beat hold_at_20 over 60% of the points.