So, I want to program a card playing engine**, but the engine needs to be able to calculate while it's the opponent's turn (so it makes moves quicker and for other obvious reasons). Meaning there has to be a certain block of code that's always running, unfortunately I don't know how to do that. Ideas and help would be appreciated.

** It should play Thirteen when completed (A variation of Tien Len )

--Random