Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 12, 2023. It is now read-only.
/EOCProjectPublic archive

Commitee21b57

Browse files
authored
Update tictactoe.md
1 parent63fdb51 commitee21b57

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

‎docs/tictactoe.md‎

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,56 +6,3 @@ nav_order: 2
66
{: .fs-9 }
77
Tic Tac Toe (also known as Xs and Os) is a game in which two players take turns marking the spaces in a 3-by-3 grid with X or O. One wins if three of their marks are in horizontal, vertical or diagonal places. It's a draw if both cannot satisfy this condition.
88
{: .fs-6 .fw-300 }
9-
10-
#Implementation in this Project
11-
##Class Name: TicTacToe
12-
##Fields
13-
14-
| Name| Data Type| Description|
15-
|:--------------|:------------------|-------------------------------------|
16-
| Board| Array of Arrays| Stores the values in the board|
17-
| currentPlayer| Integer| Who is the current Player?|
18-
| currentValue| String| What is the current Value? (X or O)|
19-
| blank (" ")| String| Blank String for comparing|
20-
| X ("X")| String| String Letter "X" for comparing|
21-
| O ("O")| String| String Letter "O" for comparing|
22-
23-
24-
##Methods - User Interface
25-
Methods used for creating the User Interface
26-
27-
| Name| Parameters| Return Type| Description|
28-
|:-------------------------|:---------------|--------------------|---------------------------------------------------|
29-
| TicTacToe (Constructor)| None| Object (TicTacToe)| Creates an instance of class|
30-
| drawBoard| None| Void| Draws the Tic Tac Toe Grid|
31-
| UI| None| Void| Draws the Interface for Input & Grid|
32-
33-
34-
##Methods - Change Interface
35-
Methods used for changing the User Interface
36-
37-
| Name| Parameters| Return Type| Description|
38-
|:-------------------------|:-------------------------------|--------------------|---------------------------------------------------|
39-
| changeCurrentPlayer| None| Void| Changes the Current Player & value|
40-
| setX| Position (int)| Void| Changes Value from blank to X at given position|
41-
| setO| Position (int)| Void| Changes Value from blank to O at given position|
42-
43-
44-
##Methods - Helpher Methods for Changing the Interface
45-
Helper Methods used for Main Methods of Changing the Interface
46-
47-
| Name| Parameters| Return Type| Description|
48-
|:-------------------------|:-------------------------------|--------------------|---------------------------------------------------|
49-
| currentValue| Position (int)| String| Returns the corresponding value at given position|
50-
| setValue| Position (int), Value (String)| Void| Sets the given value at given position|
51-
| remainder| Dividend (int), Divisior (int)| Integer| Returns the Remainder of given values|
52-
53-
54-
##Logical Methods - Checking the Conditions
55-
56-
Main Logic to check if the player is won or game is draw.
57-
58-
| Name| Parameters| Return Type| Description|
59-
|:-------------------------|:-------------------------------|--------------------|---------------------------------------------------|
60-
| checkIfWon| Void| Boolean| Check if the player is won|
61-
| checkIfDraw| Void| Boolean| Check if the game is draw|

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp