-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
134 lines (134 loc) · 36.4 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!doctype html>
<html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title> - Documentation</title><link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500|Roboto:300,500,700" rel="stylesheet"/><style>body{margin: 0;
padding: 0;
color: #000;
font-family: Roboto, sans-serif;
font-weight: 300;
line-height: 26px;
font-size: 17px;}*{-moz-box-sizing: border-box;
box-sizing: border-box;}</style></head><body><main id="app"><div data-radium="true"><div style="position:fixed;box-shadow:0px 2px 3px 0px rgba(0, 0, 0, 0.25);width:100%;min-width:100%;margin-left:0px;margin-right:0px;height:65px;z-index:99;background:#FFFFFF;padding-top:10px;padding-bottom:10px;padding-left:20px;padding-right:20px;" data-radium="true"><div style="margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px;" class="rmq-87b609c0 rmq-159a7c96 rmq-27601239" data-radium="true"><div style="margin-left:-15px;margin-right:-15px;" data-radium="true"><div style="position:relative;min-height:1px;padding-left:15px;padding-right:15px;float:left;width:50.00000%;" class="rmq-aa1729d5 rmq-a22eaf97 rmq-1918856d rmq-6156e77b rmq-21ab0466 rmq-a01b93a4 rmq-d226cb7e rmq-5cc71c8" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:inherit;font-size:36px;margin-right:20px;"><g><path d="m30 22.5h-5c-1.3 0-2.5 1.3-2.5 2.5h10c0-1.3-1.2-2.5-2.5-2.5z m-2.1-16.2c-6.6 0-8.2 1.2-9.1 2.1-1-0.9-2.6-2.1-9.2-2.1s-9.6 1.7-9.6 3v22.9c1.1-0.6 4.6-1.9 8.4-2.2 4.4-0.4 9.1 0.4 9.1 1.2 0 0.7 0.3 1.3 1.2 1.3h0.1c0.9 0 1.2-0.6 1.2-1.2 0-0.9 4.6-1.7 9.1-1.3 3.7 0.3 7.3 1.6 8.4 2.2v-22.9c0-1.3-3.1-3-9.6-3z m-10.4 22.3c-1.2-0.6-4-1.1-7.5-1.1s-6.6 0.5-7.5 1.1v-17.3s2.5-2.4 7.5-2.4 7.5 1.1 7.5 2.4v17.3z m17.5 0c-0.9-0.6-4-1.1-7.5-1.1s-6.3 0.5-7.5 1.1v-17.3s2.5-2.4 7.5-2.4 7.5 1.1 7.5 2.4v17.3z m-5-11.1h-5c-1.3 0-2.5 1.3-2.5 2.5h10c0-1.3-1.2-2.5-2.5-2.5z m0-5h-5c-1.3 0-2.5 1.3-2.5 2.5h10c0-1.3-1.2-2.5-2.5-2.5z m-17.5 5h-5c-1.2 0-2.5 1.2-2.5 2.5h10c0-1.2-1.2-2.5-2.5-2.5z m0 5h-5c-1.2 0-2.5 1.2-2.5 2.5h10c0-1.2-1.2-2.5-2.5-2.5z m0-10h-5c-1.2 0-2.5 1.2-2.5 2.5h10c0-1.2-1.2-2.5-2.5-2.5z"></path></g></svg><div style="display:inline-block;" data-radium="true"><div style="text-transform:uppercase;font-family:Roboto, sans-serif;" data-radium="true"></div><div style="font-family:Roboto Mono, Menlo, Monaco, Courier, monospace;font-weight:300;" data-radium="true"></div></div></div><div style="position:relative;min-height:1px;padding-left:15px;padding-right:15px;float:right !important;width:25.00000%;text-align:right;font-size:36px;" class="rmq-aa1729d5 rmq-a22eaf97 rmq-1918856d rmq-6156e77b rmq-77267d84 rmq-5c0c1446 rmq-4605701c rmq-34ee8e6a" data-radium="true"><a href="https://github.com/willicommer/dots-and-boxes#readme"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m20 0c-11 0-20 9-20 20 0 8.8 5.7 16.3 13.7 19 1 0.2 1.3-0.5 1.3-1 0-0.5 0-2 0-3.7-5.5 1.2-6.7-2.4-6.7-2.4-0.9-2.3-2.2-2.9-2.2-2.9-1.9-1.2 0.1-1.2 0.1-1.2 2 0.1 3.1 2.1 3.1 2.1 1.7 3 4.6 2.1 5.8 1.6 0.2-1.3 0.7-2.2 1.3-2.7-4.5-0.5-9.2-2.2-9.2-9.8 0-2.2 0.8-4 2.1-5.4-0.2-0.5-0.9-2.6 0.2-5.3 0 0 1.7-0.5 5.5 2 1.6-0.4 3.3-0.6 5-0.6 1.7 0 3.4 0.2 5 0.7 3.8-2.6 5.5-2.1 5.5-2.1 1.1 2.8 0.4 4.8 0.2 5.3 1.3 1.4 2.1 3.2 2.1 5.4 0 7.6-4.7 9.3-9.2 9.8 0.7 0.6 1.4 1.9 1.4 3.7 0 2.7 0 4.9 0 5.5 0 0.6 0.3 1.2 1.3 1 8-2.7 13.7-10.2 13.7-19 0-11-9-20-20-20z"></path></g></svg></a></div><div style="clear:both;" data-radium="true"></div></div><div style="clear:both;" data-radium="true"></div></div></div><div style="margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px;padding-top:104px;" class="rmq-87b609c0 rmq-159a7c96 rmq-27601239" data-radium="true"><div style="margin-left:-15px;margin-right:-15px;" data-radium="true"><div style="position:fixed;min-height:1px;padding-left:15px;padding-right:15px;float:left;width:8.33333%;height:80%;max-width:300px;" class="rmq-aa1729d5 rmq-a22eaf97 rmq-1918856d rmq-6156e77b rmq-5c4c5b38 rmq-5c0c1446 rmq-4605701c rmq-34ee8e6a rmq-35757987 rmq-f09e82ae" data-radium="true"><div style="font-family:Roboto, sans-serif;border-radius:4px;padding-top:0;padding-bottom:0;margin-top:26px;border:1px solid #e6e9ed;font-weight:500;font-size:15px;line-height:18px;max-height:70vh;overflow-x:auto;" data-radium="true"><ul style="list-style:none;margin-top:0;margin-bottom:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><a style="color:#000;" href="#const" data-radium="true">CONST</a></li></div><div data-radium="true"><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><a style="color:#000;" href="#game" data-radium="true">Game</a></li><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><div style="padding-top:0;" data-radium="true"><span style="text-transform:uppercase;font-size:13px;line-height:18px;color:#666;" data-radium="true">Instance</span><ul style="list-style:none;padding-left:0;" data-radium="true"><li data-radium="true"><a href="#gamescores" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">scores</a></li><li data-radium="true"><a href="#gamescoreuser" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">scoreUser</a></li><li data-radium="true"><a href="#gamescorecomputer" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">scoreComputer</a></li><li data-radium="true"><a href="#gamesize" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">size</a></li><li data-radium="true"><a href="#gamegameover" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">gameOver</a></li><li data-radium="true"><a href="#gameexecuteuserturn" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">executeUserTurn</a></li><li data-radium="true"><a href="#gameexecuteautoturn" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">executeAutoTurn</a></li><li data-radium="true"><a href="#gameexecutesingleturn" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">executeSingleTurn</a></li><li data-radium="true"><a href="#gamesavegame" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">saveGame</a></li><li data-radium="true"><a href="#gamerestoregame" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">restoreGame</a></li><li data-radium="true"><a href="#gameissaved" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">isSaved</a></li><li data-radium="true"><a href="#gamecheckline" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">checkLine</a></li></ul></div></li></div><div data-radium="true"><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><a style="color:#000;" href="#board" data-radium="true">Board</a></li><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><div style="padding-top:0;" data-radium="true"><span style="text-transform:uppercase;font-size:13px;line-height:18px;color:#666;" data-radium="true">Instance</span><ul style="list-style:none;padding-left:0;" data-radium="true"><li data-radium="true"><a href="#boardclone" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">clone</a></li><li data-radium="true"><a href="#boardget2d" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">get2d</a></li><li data-radium="true"><a href="#boardgetscores" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">getScores</a></li><li data-radium="true"><a href="#boardexecutesingleturn" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">executeSingleTurn</a></li></ul></div></li></div><div data-radium="true"><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><a style="color:#000;" href="#box" data-radium="true">Box</a></li><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><div style="padding-top:0;" data-radium="true"><span style="text-transform:uppercase;font-size:13px;line-height:18px;color:#666;" data-radium="true">Instance</span><ul style="list-style:none;padding-left:0;" data-radium="true"><li data-radium="true"><a href="#boxid" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">id</a></li><li data-radium="true"><a href="#boxpos" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">pos</a></li><li data-radium="true"><a href="#boxlines" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">lines</a></li><li data-radium="true"><a href="#boxowner" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">owner</a></li><li data-radium="true"><a href="#boxiscomplete" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">isComplete</a></li><li data-radium="true"><a href="#boxiscompleteifline" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">isCompleteIfLine</a></li></ul></div></li></div><div data-radium="true"><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><a style="color:#000;" href="#constructor" data-radium="true">constructor</a></li></div><div data-radium="true"><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><a style="color:#000;" href="#isset" data-radium="true">isSet</a></li></div><div data-radium="true"><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><a style="color:#000;" href="#score" data-radium="true">score</a></li></div><div data-radium="true"><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><a style="color:#000;" href="#describe" data-radium="true">describe</a></li></div><div data-radium="true"><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><a style="color:#000;" href="#side" data-radium="true">side</a></li></div><div data-radium="true"><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:1px solid #e6e9ed;" data-radium="true"><a style="color:#000;" href="#pos" data-radium="true">Pos</a></li><li style="padding-left:20px;padding-right:20px;padding-top:13px;padding-bottom:13px;border-bottom:none;" data-radium="true"><div style="padding-top:0;" data-radium="true"><span style="text-transform:uppercase;font-size:13px;line-height:18px;color:#666;" data-radium="true">Instance</span><ul style="list-style:none;padding-left:0;" data-radium="true"><li data-radium="true"><a href="#posdescribe" style="font-family:Roboto, sans-serif;font-weight:300;font-size:13px;line-height:16px;text-decoration:none;color:#555;" data-radium="true">describe</a></li></ul></div></li></div></ul></div></div><div style="position:relative;min-height:1px;padding-left:15px;padding-right:15px;float:left;width:100.00000%;" class="rmq-aa1729d5 rmq-a22eaf97 rmq-1918856d rmq-6156e77b rmq-89bb2272 rmq-2d0e68c6 rmq-3752549c rmq-3b9282ea rmq-4d29a8df rmq-ea7683a5 rmq-ad95cc33" data-radium="true"><div class="content" data-radium="true"><style>h1, h2, h3, h4, h5, h6{font-family: Roboto, sans-serif;
font-weight: 300;}h1{font-size: 48px;
line-height: 72px;}h2{font-size: 24px;
line-height: 36px;}h3{font-size: 19px;
line-height: 29px;
font-weight: 400;}h4{font-size: 17px;
line-height: 22px;
font-weight: 400;}a{text-decoration: none;
color: #00AAFF;
:hover: [object Object];}a.anchor:before{content: "";
display: block;
height: 100px;
margin: -80px 0 0;}.content blockquote{padding-left: 20px;
margin: 0;
border-left: 4px solid #eee;}.content ul, content li{list-style: none;}.content ul li:before{color: #CCC;
float: left;
margin-left: -20px;
margin-top: 1px;
content: "•";}pre.hljs, pre > code{margin-bottom: 30px;
font-family: Roboto Mono, Menlo, Monaco, Courier, monospace;
padding: 12px 15px 12px 15px;
border-radius: 4px;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
display: block;
position: relative;
overflow-x: auto;
font-size: 13px;
color: #666;
white-space: pre;}code{font-family: Roboto Mono, Menlo, Monaco, Courier, monospace;
display: inline;
font-size: 13px;
font-weight: 400;
margin: 0 2px;
padding: 1px 6px;
box-shadow: 0 0 0 1px #DDD;
white-space: nowrap;
border-radius: 4px;}.hljs{display: block;
overflow-x: auto;}.hljs-comment, .hljs-quote{color: #998;
font-style: italic;}.hljs-keyword, .hljs-selector-tag, .hljs-subst{color: #333;
font-weight: bold;}.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable, .hljs-tag .hljs-attr{color: #008080;}.hljs-string, .hljs-doctag{color: #d14;}.hljs-title, .hljs-section, .hljs-selector-id{color: #900;
font-weight: bold;}.hljs-subst{font-weight: normal;}.hljs-type, .hljs-class .hljs-title{color: #458;
font-weight: bold;}.hljs-tag, .hljs-name, .hljs-attribute{color: #000080;
font-weight: normal;}.hljs-regexp, .hljs-link{color: #009926;}.hljs-symbol, .hljs-bullet{color: #990073;}.hljs-built_in, .hljs-builtin-name{color: #0086b3;}.hljs-meta{color: #999;
font-weight: bold;}.hljs-deletion{background: #fdd;}.hljs-addition{background: #dfd;}.hljs-emphasis{font-style: italic;}.hljs-strong{font-weight: bold;}</style><div style="margin-bottom:104px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="const"></a>CONST</h1><div><p>Constant definitons</p>
</div></div><div style="margin-bottom:104px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="game"></a>Game</h1><div><p>Game</p>
</div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>opt: type (=options.default)</code>: <div style="display:inline-block;" data-radium="true">options
</div></li></div></ol></div><div data-radium="true"><h2 style="text-transform:uppercase;" data-radium="true">instance</h2><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gamescores"></a>Game.prototype.scores</h3><pre><code>scores</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a><integer></code><span> [0]
=number of empty fields,
[1]
=number of user fields,
[2]
=number of computer fields
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gamescoreuser"></a>Game.prototype.scoreUser</h3><pre><code>scoreUser</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code>integer</code><span> number of user fields
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gamescorecomputer"></a>Game.prototype.scoreComputer</h3><pre><code>scoreComputer</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code>integer</code><span> number of computer fields
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gamesize"></a>Game.prototype.size</h3><pre><code>size</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></code><span> {x,y} board size
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gamegameover"></a>Game.prototype.gameOver</h3><pre><code>gameOver</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><span>
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gameexecuteuserturn"></a>Game.prototype.executeUserTurn</h3><pre><code>executeUserTurn(line: (Line | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | integer), player: integer, level: integer): integer</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>line: (Line | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | integer)</code>: <div style="display:inline-block;" data-radium="true">, see
<a href="#gamecheckline">
checkLine
</a>
</div></li></div><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>player: integer (=this.player)</code>: <div style="display:inline-block;" data-radium="true"></div></li></div><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>level: integer (=this.level)</code>: <div style="display:inline-block;" data-radium="true"></div></li></div></ol></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code>integer</code><span> score for turn
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gameexecuteautoturn"></a>Game.prototype.executeAutoTurn</h3><pre><code>executeAutoTurn(player: integer, level: integer): integer</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>player: integer (=this.player)</code>: <div style="display:inline-block;" data-radium="true"></div></li></div><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>level: integer (=this.level)</code>: <div style="display:inline-block;" data-radium="true"></div></li></div></ol></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code>integer</code><span> score for turn
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gameexecutesingleturn"></a>Game.prototype.executeSingleTurn</h3><pre><code>executeSingleTurn(line: (Line | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | integer), player: integer): integer</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"><p>internal turn</p>
</div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>line: (Line | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | integer)</code>: <div style="display:inline-block;" data-radium="true">, see
<a href="#gamecheckline">
checkLine
</a>
</div></li></div><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>player: integer</code>: <div style="display:inline-block;" data-radium="true"></div></li></div></ol></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code>integer</code><span> score for turn
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gamesavegame"></a>Game.prototype.saveGame</h3><pre><code>saveGame()</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"><p>store actual game on stack</p>
</div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gamerestoregame"></a>Game.prototype.restoreGame</h3><pre><code>restoreGame()</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"><p>restore last game from stack</p>
</div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gameissaved"></a>Game.prototype.isSaved</h3><pre><code>isSaved()</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"><p>check if restoreGame() is possible
returns {boolean}</p>
</div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="gamecheckline"></a>Game.prototype.checkLine</h3><pre><code>checkLine(value: (Line | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | integer)): any</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>value: (Line | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | integer)</code>: <div style="display:inline-block;" data-radium="true"></div></li></div></ol></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code>any</code><span> Line
</span></div></div><div data-radium="true"><div data-radium="true"><h4>Example</h4><pre><code>checkLine( <span class="hljs-number">2</span> ); <span class="hljs-comment">// return line with id=2</span>
checkLine( <span class="hljs-string">"2"</span> ); <span class="hljs-comment">// return line with id=2</span>
<span class="hljs-keyword">var</span> line = board.boxAtPos(<span class="hljs-number">1</span>,<span class="hljs-number">1</span>).lines.left;
checkline( line ); <span class="hljs-comment">// returns left line of box[1,1]</span>
checkLine( <span class="hljs-string">"1 1 left"</span> ); <span class="hljs-comment">// returns left line of box[1,1]</span></code></pre></div></div></div></div></div><div style="margin-bottom:104px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="board"></a>Board</h1><div><p>Board</p>
</div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>size: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a> (=options.default.size)</code>: <div style="display:inline-block;" data-radium="true">{x,y}
</div></li></div></ol></div><div data-radium="true"><h2 style="text-transform:uppercase;" data-radium="true">instance</h2><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="boardclone"></a>Board.prototype.clone</h3><pre><code>clone(): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></code><span> copy of game
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="boardget2d"></a>Board.prototype.get2d</h3><pre><code>get2d()</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="boardgetscores"></a>Board.prototype.getScores</h3><pre><code>getScores(): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a><integer></code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a><integer></code><span> [0]
=number of empty fields,
[1]
=number of user fields,
[2]
=number of computer fields
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="boardexecutesingleturn"></a>Board.prototype.executeSingleTurn</h3><pre><code>executeSingleTurn(line: (Line | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | integer), player: integer)</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"><p>set line for player and possible complete the box, no checks done</p>
</div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>line: (Line | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | integer)</code>: <div style="display:inline-block;" data-radium="true">@link {#checkline}
</div></li></div><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>player: integer</code>: <div style="display:inline-block;" data-radium="true"></div></li></div></ol></div></div></div></div><div style="margin-bottom:104px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="box"></a>Box</h1><div><p>Object to describing one board cell</p>
</div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>id: integer</code>: <div style="display:inline-block;" data-radium="true">of box
</div></li></div><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>pos: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></code>: <div style="display:inline-block;" data-radium="true">{x,y}
</div></li></div></ol></div><div data-radium="true"><h2 style="text-transform:uppercase;" data-radium="true">instance</h2><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="boxid"></a>Box.prototype.id</h3><pre><code>id</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="boxpos"></a>Box.prototype.pos</h3><pre><code>pos</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="boxlines"></a>Box.prototype.lines</h3><pre><code>lines</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="boxowner"></a>Box.prototype.owner</h3><pre><code>owner</code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="boxiscomplete"></a>Box.prototype.isComplete</h3><pre><code>isComplete(): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></code><span> true if all lines set
</span></div></div></div><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="boxiscompleteifline"></a>Box.prototype.isCompleteIfLine</h3><pre><code>isCompleteIfLine(line: integer): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>line: integer</code>: <div style="display:inline-block;" data-radium="true"></div></li></div></ol></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></code><span> true if all lines set except this one in parameter
</span></div></div></div></div></div><div style="margin-bottom:104px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="constructor"></a>constructor</h1><div></div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>id: type</code>: <div style="display:inline-block;" data-radium="true"></div></li></div></ol></div></div><div style="margin-bottom:104px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="isset"></a>isSet</h1><div></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><span> has it a owner
</span></div></div></div><div style="margin-bottom:104px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="score"></a>score</h1><div></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code>integer</code><span>
</span></div></div></div><div style="margin-bottom:104px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="describe"></a>describe</h1><div></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><span>
</span></div></div></div><div style="margin-bottom:104px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="side"></a>side</h1><div><p>returns {Line} the neighbour line</p>
</div></div><div style="margin-bottom:104px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="pos"></a>Pos</h1><div><p>Pos</p>
</div><div data-radium="true"><h4>Parameters</h4><ol style="list-style:none;margin-left:0;padding-left:0;" data-radium="true"><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>x: type</code>: <div style="display:inline-block;" data-radium="true"></div></li></div><div data-radium="true"><li style="padding-bottom:13px;" data-radium="true"><code>y: type</code>: <div style="display:inline-block;" data-radium="true"></div></li></div></ol></div><div data-radium="true"><div data-radium="true"><h4>Example</h4><pre><code><span class="hljs-keyword">new</span> Pos(<span class="hljs-number">1</span>,<span class="hljs-number">2</span>);
<span class="hljs-keyword">new</span> Pos(<span class="hljs-string">'1'</span>,<span class="hljs-string">'2'</span>)
<span class="hljs-keyword">new</span> Pos({<span class="hljs-attr">x</span>:<span class="hljs-number">1</span>,<span class="hljs-attr">y</span>:<span class="hljs-number">2</span>})</code></pre></div></div><div data-radium="true"><h2 style="text-transform:uppercase;" data-radium="true">instance</h2><div style="margin-bottom:52px;" data-radium="true"><h3 data-radium="true"><a class="anchor" name="posdescribe"></a>Pos.prototype.describe</h3><pre><code>describe(): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></pre><div style="margin-top:13px;margin-bottom:13px;" data-radium="true"></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><span>
</span></div></div></div></div></div></div></div><div style="clear:both;" data-radium="true"></div></div><div style="clear:both;" data-radium="true"></div></div><style>@media (min-width: 768px) and (max-width: 991px){ .rmq-87b609c0{width: 750px !important;}}
@media (min-width: 992px) and (max-width: 1199px){ .rmq-159a7c96{width: 970px !important;}}
@media (min-width: 1200px){ .rmq-27601239{width: 1170px !important;}}
@media (min-width: 480px) and (max-width: 767px){ .rmq-aa1729d5{float: left !important;}}
@media (min-width: 768px) and (max-width: 991px){ .rmq-a22eaf97{float: left !important;}}
@media (min-width: 992px) and (max-width: 1199px){ .rmq-1918856d{float: left !important;}}
@media (min-width: 1200px){ .rmq-6156e77b{float: left !important;}}
@media (min-width: 480px) and (max-width: 767px) { .rmq-21ab0466{width: 50.00000% !important;}}
@media (min-width: 768px) and (max-width: 991px) { .rmq-a01b93a4{width: 50.00000% !important;}}
@media (min-width: 992px) and (max-width: 1199px) { .rmq-d226cb7e{width: 50.00000% !important;}}
@media (min-width: 1200px) { .rmq-5cc71c8{width: 50.00000% !important;}}
@media (min-width: 480px) and (max-width: 767px) { .rmq-77267d84{width: 25.00000% !important;}}
@media (min-width: 768px) and (max-width: 991px) { .rmq-5c0c1446{width: 25.00000% !important;}}
@media (min-width: 992px) and (max-width: 1199px) { .rmq-4605701c{width: 25.00000% !important;}}
@media (min-width: 1200px) { .rmq-34ee8e6a{width: 25.00000% !important;}}
@media (min-width: 480px) and (max-width: 767px) { .rmq-5c4c5b38{width: 8.33333% !important;}}
@media (max-width: 479px){ .rmq-35757987{display: none !important;}}
@media (min-width: 480px) and (max-width: 767px) { .rmq-f09e82ae{display: none !important;}}
@media (min-width: 480px) and (max-width: 767px) { .rmq-89bb2272{width: 100.00000% !important;}}
@media (min-width: 768px) and (max-width: 991px) { .rmq-2d0e68c6{width: 66.66667% !important;}}
@media (min-width: 992px) and (max-width: 1199px) { .rmq-3752549c{width: 66.66667% !important;}}
@media (min-width: 1200px) { .rmq-3b9282ea{width: 66.66667% !important;}}
@media (min-width: 768px) and (max-width: 991px) { .rmq-4d29a8df{left: 33.33333% !important;}}
@media (min-width: 992px) and (max-width: 1199px) { .rmq-ea7683a5{left: 33.33333% !important;}}
@media (min-width: 1200px) { .rmq-ad95cc33{left: 33.33333% !important;}}</style></div></main></body></html>