-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
47 lines (46 loc) · 1.74 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html ng-app="loseItApp">
<head>
<meta charset="utf-8">
<title>tic-tac</title>
<style>
table{
border-collapse: collapse;
}
td{
border: 1px solid;
border-collapse: collapse;
width: 30px;
height: 30px;
text-align: center;
}
td:hover{
cursor: pointer;
}
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
</head>
<body ng-controller="mainCntr">
<div class="beforeGame" ng-if="gameState==0">
<input placeholder="Board Size" type="number" ng-model="board.size">
<button ng-click="startGame(board.size)">just start game! with {{pastBoardSize}}x{{pastBoardSize}}</button>
</div>
<div class="duringGame" ng-if="gameState>=2">
<table>
<tbody>
<tr ng-repeat="r in numberToArray(config.m)">
<td ng-repeat="c in numberToArray(config.n)" ng-click="handleClick($parent.$index,$index)">{{showMatrixValue($parent.$index,$index)==1?'O':showMatrixValue($parent.$index,$index)==2?'X':''}}</td>
</tr>
</tbody>
</table>
<button ng-if="gameState==3" ng-click="startGame(board.size)">reset game!</button>
</div>
<p>{{flag.gameStatusText}}</p>
<div class="afterGame" ng-if="gameState>=10">
<input placeholder="Board Size" type="number" ng-model="board.size">
<button ng-click="startGame(board.size)">restart game!<!-- with {{pastBoardSize}}x{{pastBoardSize}} --></button>
<button ng-click="startGame(defaultBoardSize)" ng-if="defaultBoardSize!=pastBoardSize"> with {{defaultBoardSize}}x{{defaultBoardSize}}</button>
</div>
<script type="text/javascript" src="./app.js"></script>
</body>
</html>