This took me about half an hour, and boy did i hate every second of it!
the strenuos part was actually programming AI into it.
it is the STUPIDEST ai you will ever see but it works.
and sadly, yes, you CAN be beaten by the AI.
also, very sadly, i have been beaten by my own crappy AI