Flash games that use rng tend to use a time based algorithm, with something where there are only two options, it is probably not the best way of doing things, but it kinda works.