You are the red square. The com is the hungry blue character. Move left, right, up, or down by pressing the respective keys. You cannot leave the grid. To win (see the notes), you must move onto the square containing your opponent. There is a half-second delay after you move and before the com moves to prevent the same key from being falsely seen as being pressed multiple times.
I can give you a 100% guarantee that you will LOSE this game unless you mess with the code. Player 2, if playing properly, will always win in no more than three moves. It is impossible for Player 1 to win.