SlideShare a Scribd company logo
1 of 22
TIC –TAC TOE
Creating your owngame
IMPLEMENTATION
HTML TABLE
CSSFORSTYLING
javaScript
IMPLEMENTATION
HTML TABLE
CSSFORSTYLING
A table consists of
rows and columns
IMPLEMENTATION
Question!
A = ?
B = ?
A
B
IMPLEMENTATION
Answer!
A points to the column
B points to the row
A
B
IMPLEMENTATION
#
Question!
# is at :
Column = ?
Row = ?
IMPLEMENTATION
#
Answer!
# is at :
Column = 2
Row = 2
1 2 3
123
C o l u m n
Ro w
IMPLEMENTATION
HTML TABLE
CSSFORSTYLING
How do we use
this to create our
game?
IMPLEMENTATION
HTML TABLE
<table>
……
</table>
<table>
is used to create tables in
HTML
IMPLEMENTATION
HTML TABLE
<table>
< tr>….</tr>
</table>
<tr>
is used to add a row to the
table
IMPLEMENTATION
HTML TABLE <table>
<tr>
<td>..</td>
</tr>
</table>
<td>
is used to add a column to
the row
IMPLEMENTATION
Question!
How many rows and
columns for this table?
IMPLEMENTATION
Answer!
3 rows and 3 columns
HTML & CSS
Task : 1
Create an HTML code for a
table with 3 rows and 3
columns.
Use CSS to
decorate your
table
JAVASCRIPT :
functions()Task : 2
Create javaScript function that adds
an “X” to the table on the position
clicked.
JAVASCRIPT(examp
le)
For example, the value of
the table at row 1 and
column 0 changes to X
when it is clicked!
JAVASCRIPT(examp
le)
For example, the value of
the table at row 1 and
column 2 changes to X
when it is clicked!
X
If (statements):
Task : 3
Modify your function so that it
checks if the clicked position is
already taken before proceeding to
add the “x”
X
Math.random()
Task : 4
Modify your function Use the
random method to place an “O” on
an open space.
X
O
Using API
Task : 5
Use the functions provided to from
the java-script file provided by the
facilitator to complete your game!
X
O
Have
fun!

More Related Content

Similar to Tic –tac toe

MYSQL
MYSQLMYSQL
MYSQL
ARJUN
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commands
Belle Wx
 

Similar to Tic –tac toe (20)

Table and Form HTML&CSS
Table and Form HTML&CSSTable and Form HTML&CSS
Table and Form HTML&CSS
 
3.1 html lec 3
3.1 html lec 33.1 html lec 3
3.1 html lec 3
 
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
Views, Triggers, Functions, Stored Procedures,  Indexing and JoinsViews, Triggers, Functions, Stored Procedures,  Indexing and Joins
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
 
Web design - Working with tables in HTML
Web design - Working with tables in HTMLWeb design - Working with tables in HTML
Web design - Working with tables in HTML
 
HTML Tutorials
HTML TutorialsHTML Tutorials
HTML Tutorials
 
dbms lab manual
dbms lab manualdbms lab manual
dbms lab manual
 
WEP4 and 5.pptx
WEP4 and 5.pptxWEP4 and 5.pptx
WEP4 and 5.pptx
 
Sql Injection
Sql Injection Sql Injection
Sql Injection
 
01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx
 
table html web programing
table  html  web programingtable  html  web programing
table html web programing
 
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small ScreensFlipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
 
Lettering js
Lettering jsLettering js
Lettering js
 
Chapter 8: Tables
Chapter 8: TablesChapter 8: Tables
Chapter 8: Tables
 
MYSQL
MYSQLMYSQL
MYSQL
 
Html table tags
Html table tagsHtml table tags
Html table tags
 
Set Operators, Derived Tables and CTEs
Set Operators, Derived Tables and CTEsSet Operators, Derived Tables and CTEs
Set Operators, Derived Tables and CTEs
 
Set operators - derived tables and CTEs
Set operators - derived tables and CTEsSet operators - derived tables and CTEs
Set operators - derived tables and CTEs
 
Sql commands
Sql commandsSql commands
Sql commands
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commands
 
CSS3 Ready for Primetime
CSS3 Ready for PrimetimeCSS3 Ready for Primetime
CSS3 Ready for Primetime
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 

Recently uploaded (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

Tic –tac toe