-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrockBot.js
51 lines (43 loc) · 1.04 KB
/
rockBot.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
class Bot {
constructor () {
this.roundCount = 0;
this.roundWeight = 1;
this.myBot = {
'dynamites': 100,
'waterBlns': 0,
'scissors': 0,
'papers': 0,
'rocks': 0
};
this.opponent = {
'dynamites': 100,
'waterBlns': 0,
'scissors': 0,
'papers': 0,
'rocks': 0
};
// this.myBot = this.robot;
// this.opponent = this.robot;
}
playRandom(max) {
let move = Math.floor(Math.random() * max);
switch (move) {
case 0:
return 'R';
case 1:
return 'P';
case 2:
return 'S';
case 3:
return 'D';
case 4:
return 'W';
default:
return 'P';
}
}
makeMove(gamestate) {
return 'P';
}
}
module.exports = new Bot();