|
@@ -359,19 +359,24 @@ for (var i = 0; i < predictArray.length; i++) {
|
|
|
}
|
|
|
|
|
|
while(true){
|
|
|
-
|
|
|
if(predictArray[histor[0]][histor[1]][histor[2]][histor[3]] > -1)
|
|
|
console.log(predictArray[histor[0]][histor[1]][histor[2]][histor[3]]);
|
|
|
else{
|
|
|
console.log(Math.floor(Math.random() * 2) + "rand");
|
|
|
}
|
|
|
|
|
|
-var userNumber = +prompt("Введите 0 или 1");
|
|
|
-
|
|
|
+var userNumber = prompt("Введите 0 или 1");
|
|
|
+if(userNumber === "1" || userNumber === "0"){
|
|
|
+ parseInt(userNumber);
|
|
|
+}
|
|
|
+else{
|
|
|
+ break;
|
|
|
+}
|
|
|
predictArray[histor[0]][histor[1]][histor[2]][histor[3]] = userNumber;
|
|
|
histor.push(userNumber);
|
|
|
histor.shift();
|
|
|
}
|
|
|
+
|
|
|
```
|
|
|
|
|
|
|