pseudo code for computer play