-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
61 lines (52 loc) · 1.09 KB
/
app.js
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
/**
====================================================
REVERSI
by p.demanget
created: 2015-01-15
modified: 2015-01-29
refactor:
board: board values content + ui actions
app: main actions + window event
d.js: display framework
options: options screen
global objects:
-app
====================================================
*/
//TODO persist bug + lost bug
var app={
params:{
player1:localStorage.player1|| 'Human',
player2:localStorage.player2|| 'Computer'
},
game:{
started:false,
over: false
},
scores:{
Human:{
win:localStorage.scoresWinHuman|| 0,
lost:localStorage.scoresLostHuman||0
},
Computer:{
win:localStorage.scoresWinComputer||0,
lost:localStorage.scoresLostComputer||0
}
}
};
function pageLoaded(){
doHash();
app.addLink();
board.outprintappend("press Start");
}
function doHash(){
if (window.location.hash=="#options"){
if( ! window0) param();
}
}
app.addLink= function(){
d.links.restart=board.restart;
d.links.options=param;
d.addLink();
}
window.onhashchange=doHash;