-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom_intelligence_test.html
More file actions
77 lines (75 loc) · 3.1 KB
/
random_intelligence_test.html
File metadata and controls
77 lines (75 loc) · 3.1 KB
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
<!DOCTYPE html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<title>Random Intelligence Test</title>
<style>
html, body {
width: 100%;
height: 100%;
}
.f16 {font-size: 16pt; color: #000000;}
</style>
<body bgcolor=#FCFCFC>
<p align=left class=f16>
Let’s play RIT:<br><a href="https://github.com/ogrnv/random-intelligence-tests" target="_blank">https://github.com/ogrnv/random-intelligence-tests</a><br>
<a href="https://github.com/ogrnv/Quantifying-how-close-an-AI-is-to-AGI-at-any-given-time" target="_blank">https://github.com/ogrnv/Quantifying-how-close-an-AI-is-to-AGI-at-any-given-time</a><br><br>
There is only one player in the game - you.<br><br>
Let TB be given board with chips or the board with chips after your move(s), TB[address] be an integer assigned to a cell with the address: zero mean an empty cell, non-zero mean a chip marked with the integer on the cell.<br><br>
Let EM be a relocation of a chip to a horizontally or vertically adjacent zero cell. As a result of this relocation, the values of TB[from] and TB[to] should swap.<br><br>
Every game move must be either an EM or a sequence of several EMs. Let the move start address be SA and the move finish address be FA. Please note: FA must not be equal to SA. Let move number be MN.<br><br>
The goal of the game is to complete it in the fewest number of moves. The game ends when YOU by your last move, complete a formation of a straight horizontal or vertical or diagonal line of five or more chips with the same marking on the game board.<br><br>
For the sake of certainty, let in an cell address [i,j], i be the row number, j be the column number and both be numbered from zero.<br><br>
The board with chips is:<br>
</p>
<p align=left class=f16 id="CELLS"></p>
<p align=left class=f16>
Please, disable any output other than printing the MN, SA, FA and the board after each move.<br>
Wait my input after each move (also after adjustment). It could be:<br>
v - ok, go to the next move;<br>
b ??? - wrong, decrease MN by 1 and come back;<br>
f - the game is over.<br>
where ??? is a reason of the error.
<br><br>THE END OF THE TEST TASK
<br><br>b "TB[SA] must be non-zero"<br>
b "TB[FA] must be zero"<br>
b "there is not any horizontally or vertically adjacent zero cell to TB[SA]"<br>
b "you made the same wrong move"<br><br>
<br>
</p>
<script>
var hm=8, //size of a side of square table/board.
kcb=2, //how many of types of chips are placed on the table
emb=22; //number of empty sells 22=64-42
var air, bir;
var Cells = [];
for (i = 0; i < hm; i++){
Cells[i] = [];
for (j = 0; j < hm; j++){
Cells[i][j] = 0;
}
}
function random(min, max) {
var mi = Math.ceil(min), ma = Math.floor(max);
return Math.floor(Math.random()*(ma-mi+1)+mi);
}
function newdesk(){
var bc, i, j;
for (i = 0; i < hm; i += 1){
for (j = 0; j < hm; j += 1){
bc=random(1, kcb);
Cells[i][j] = bc;
}
}
//empty 5 cells
n=0;
while(n<emb){
i=random(0, hm - 1);
j=random(0, hm - 1);
if(Cells[i][j]>0){Cells[i][j] = 0; n++;}
}
var s = ""; for (i=0; i<hm; i++) s=s+Cells[i]+"<br>";
document.getElementById("CELLS").innerHTML = s;
}
newdesk();
</script>
</body>
</html>