Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
Ultimate_TicTacToe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kunal Shah
Ultimate_TicTacToe
Commits
c1db2ec3
Commit
c1db2ec3
authored
8 years ago
by
Pareek Ravi
Browse files
Options
Downloads
Patches
Plain Diff
Added comments for jsdoc
parent
8b581d5f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib/script.js
+11
-3
11 additions, 3 deletions
src/lib/script.js
with
11 additions
and
3 deletions
src/lib/script.js
+
11
−
3
View file @
c1db2ec3
...
...
@@ -88,7 +88,9 @@ function nextMove() {
}
}
// alternates player turn
/**
* Switch who's turn it is for the game
*/
function
switchTurn
()
{
if
(
document
.
turn
==
"
X
"
)
{
document
.
turn
=
"
O
"
;
...
...
@@ -98,7 +100,10 @@ function switchTurn() {
setMessage
(
"
It's
"
+
document
.
turn
+
"
's turn!
"
);
}
/**
* Adding the colors to the inner square to indicate to the user where they can play their next move
* param {SQUARE} square - the small square that was cloicked by the user
*/
function
changeColour
(
square
)
{
var
boardID
;
...
...
@@ -179,7 +184,10 @@ function changeColour(square) {
}
}
}
/**
* Checks if there is a completed inner board
* @param {SQUARE} square - the square that was recently clicked
*/
function
checkCompletedBoard
(
square
)
{
var
color
=
null
;
if
(
square
.
innerText
==
'
O
'
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment