added "real ai "ai snake

This commit is contained in:
Jürg Hallenbarter
2026-05-13 18:04:41 +02:00
parent 0a91460899
commit 3d21e42d50

View File

@@ -582,7 +582,6 @@ function snakeAIappleBias(){
preferredDirections.push(3);
}
// 65% chance to go toward apple
if (
preferredDirections.length > 0 &&
random() < 0.65
@@ -699,12 +698,10 @@ function snakeAIsurvival(){
score -= distance;
}
// avoid tunnels
if (freeNeighbors <= 1){
score -= 100;
}
// slight randomness
score += random(-3, 3);
if (score > bestScore){