{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

assg3.pdf - CSCI1120 Introduction to Computing Using C Fall...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCI1120 Introduction to Computing Using C++, Fall 2016-2017 Department of Computer Science and Engineering, The Chinese University of Hong Kong Copyright © 2016 CSE, CUHK Page 1 of 4 Assignment 3: Gomoku Due: 20:00, Wed 9 Nov 2016 Full marks: 100 1 Introduction In this assignment, you will use two-dimensional array to implement a game called Gomoku ( 五子棋 ). It is played on a game board. (We assume in this assignment.) Two players O and X take turns to put their game discs into one unoccupied square of the board. The player who first forms a line of five or more consecutive discs horizontally , vertically , or diagonally \/ wins the game. (“Go” in Gomoku means “ five in Japanese.) The game is a draw when the board is full but no player wins. Figure 1 shows an example configuration of Gomoku. The character ‘.’ denotes an empty square. The rows and columns are named in numbers (0 12) and letters (A M) respectively. If Player X puts a disc to the square G7, then a diagonal line of five consecutive X's will be formed and thus X will win. A B C D E F G H I J K L M 0 . . . . . . . . . . . . . 1 . . . . . . . . . . . . . 2 . . . . . . . . . . . . . 3 . . . . . . . . . . . . . 4 . . . . . . . . . . . . . 5 . . . . . . . X X . . . . 6 . . . . . . . X O . . . . 7 . . . . . O . O O . . . . 8 . . . . . X X O O . . . . 9 . . . . X O O X X . . . .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}