Visual Studio Tic Tac Toe
Your mission, should you choose to accept it, is to create a tic-tac-toe game in Visual Basic. In case you
are not familiar with the game, the rules and some history is here:
https://en.wikipedia.org/wiki/Tic-tac-toe
There are up to 20 points available for design, and another 30 points available for programming. Full
credit will be awarded to a program that “works correctly, looks cool, and has good coding style.”
These are subjective grading criteria, which is a departure from the lockstep requirements and grading
system earlier in the course. You have a lot more freedom in this assignment, so the grading is closer to
how one might grade an essay in a writing course.
Design tips:
1)
Create
a form with 9 picture boxes
, arranged in a 3×3 grid. Each of these picture boxes can
display nothing (i.e., a blank), an X or an O. Most correct here would be to create the X and O
pictures yourself, for example by drawing them in MS Paint or a similar program. Alternatively,
find stock images on the internet. Either way, you’ll end up putting pictures in a picture box.
2)
Create
a 2-dimensional array of integer
named board. Board at (0,0) contains the current
state of the top left corner of the board, and board at (2,2) contains the state at the bottom right
corner of the board. There are three possible states for each entry in the board array:
1.
empty – assign the value 0
2.
has an X – assign the value 1
3.
has an O – assign the value 2
So, for example, if board[0][0] = 0, the top left corner is empty.
3)
At time step 0, all 9 places on the board are empty. Keep track of whether a click is an even
click or an odd click. (Odd clicks are the 1
st
, 3
rd
, 5
th
clicks etc.) When the user clicks on a picture
box, the following happens:
1.
If that box already has an X or an O in it, do nothing.
2.
If the box is empty, and it is an odd click, fill the box with an X
3.
If the box is empty, and it is an even click, fill the box with an O
4.
Update the relevant entry of board with the correct value. For example, if the user clicks the
empty upper left corner on an odd click, set board[0][0] = 1.
GRADING:
Doing steps (1) and (2) above will get you 30 extra credit points (20 for design, 10 for programming).
Adding step (3) is worth another 10 points (40 total).
If you want to end the course with a challenge, you might want to try this next piece. Note: this could
be a time sink, so only try this if you’ve already completed (1)-(3) and you want to test your
programming skill.
4)
(THE HARD-ISH PART) Test after every click whether the game is over, and stop once one
side wins or all squares have been filled. This means you have to use the board info to test
whether there are 3 X’s or O’s in a horizontal, vertical or diagonal “row.”
Completing (4) is worth 10 points, so a total of 50 points can be earned on the assignment.
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


