ISBN : 978-81-963532-2-3 (E-Book) =: represents equivalence, e.g. a=b+c means that a represents b and c. /* */: Anything appearing within /* and */ is considered as a comment. Example 1: Tic-Tac-Toe Computer Game Tic-tac-toe is a computer game in which a human player and the computer make alternative moves on a 3×3 square. A move consists of marking previously unmarked square. The player who first places three consecutive marks along a straight line on the square (i.e. along a row, column, or diagonal) wins the game. As soon as either the human player or the computer wins, a message congratulating the winner should be displayed. If neither player manages to get three consecutive marks along a straight line, but all the squares on the board are filled up, then the game is drawn. The computer always tries to win a game. (a) 46
52 Publizr Home