{
"parameters": {
"speed": ...,
"visionArea": ...,
...
},
"events": {
"getSight": [
{
"objects": ["fox", "wolf"],
"actions": [
{
"probability": 0.5,
"action": "run"
}, {
"probability": 0.5,
"action": "wait"
}
]
}, {
"objects": ["carrot"],
"actions": [
{
"probability": 1,
"action": "eat"
}
]
}
},
"hungry": [ ... ],
"thirsty": [ ... ].
...
}
}
Что я делаю не так?Не занимаетесь отладкой своей программы. Если не умеете пользоваться отладчиком, то возьмите лист бумаги, карандаш, и пошагово пройдите всю свою программу.
function rand80() {
let result = ''+Math.floor(Math.random()*10000000000);
for (let i = 0; i < 7; i++) {
result += ('0000000000'+Math.floor(Math.random()*10000000000)).substr(-10);
}
return result;
}
console.log(rand80());
78687700753019149846288536942965286843811762227419373094448469993291737449820343
positions := array[0..max_scores] of 0
foreach of scores as score
positions[score] := 1
position := 1
for i := max_scores to 0
temp := position + positions[i]
positions[i] := position
position := temp
result := array[]
foreach of alice as score
result[] := positions[score]