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

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

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 . . . .
Image of page 1

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

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern