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

Commitf725978

Browse files
committed
Add Subsections for TicTacToe
1 parentee21b57 commitf725978

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

‎docs/tictactoe/API.md‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#API
2+
##Class Name: TicTacToe
3+
4+
##Fields
5+
6+
| Name| Data Type| Description|
7+
|:--------------|:------------------|-------------------------------------|
8+
| Board| Array of Arrays| Stores the values in the board|
9+
| currentPlayer| Integer| Who is the current Player?|
10+
| currentValue| String| What is the current Value? (X or O)|
11+
| blank (" ")| String| Blank String for comparing|
12+
| X ("X")| String| String Letter "X" for comparing|
13+
| O ("O")| String| String Letter "O" for comparing|
14+
15+
16+
##Methods - User Interface
17+
Methods used for creating the User Interface
18+
19+
| Name| Parameters| Return Type| Description|
20+
|:-------------------------|:---------------|--------------------|---------------------------------------------------|
21+
| TicTacToe (Constructor)| None| Object (TicTacToe)| Creates an instance of class|
22+
| drawBoard| None| Void| Draws the Tic Tac Toe Grid|
23+
| UI| None| Void| Draws the Interface for Input & Grid|
24+
25+
26+
##Methods - Change Interface
27+
Methods used for changing the User Interface
28+
29+
| Name| Parameters| Return Type| Description|
30+
|:-------------------------|:-------------------------------|--------------------|---------------------------------------------------|
31+
| changeCurrentPlayer| None| Void| Changes the Current Player & value|
32+
| setX| Position (int)| Void| Changes Value from blank to X at given position|
33+
| setO| Position (int)| Void| Changes Value from blank to O at given position|
34+
35+
36+
##Methods - Helpher Methods for Changing the Interface
37+
Helper Methods used for Main Methods of Changing the Interface
38+
39+
| Name| Parameters| Return Type| Description|
40+
|:-------------------------|:-------------------------------|--------------------|---------------------------------------------------|
41+
| currentValue| Position (int)| String| Returns the corresponding value at given position|
42+
| setValue| Position (int), Value (String)| Void| Sets the given value at given position|
43+
| remainder| Dividend (int), Divisior (int)| Integer| Returns the Remainder of given values|
44+
45+
46+
##Logical Methods - Checking the Conditions
47+
48+
Main Logic to check if the player is won or game is draw.
49+
50+
| Name| Parameters| Return Type| Description|
51+
|:-------------------------|:-------------------------------|--------------------|---------------------------------------------------|
52+
| checkIfWon| Void| Boolean| Check if the player is won|
53+
| checkIfDraw| Void| Boolean| Check if the game is draw|

‎docs/tictactoe/tictactoe.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout:default
3+
nav_order:2
4+
---
5+
#**Tic Tac Toe**
6+
{: .fs-9 }
7+
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.
8+
{: .fs-6 .fw-300 }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp