diff --git a/Chuck.SilverFish.Test/Data/RushTest.txt b/Chuck.SilverFish.Test/Data/RushTest.txt index a24fcb4f..7fd8418c 100644 --- a/Chuck.SilverFish.Test/Data/RushTest.txt +++ b/Chuck.SilverFish.Test/Data/RushTest.txt @@ -25,7 +25,8 @@ ability: True ULD_431p fatigue: 21 0 20 0 OwnMinions: EnemyMinions: -ironfurgrizzly CS2_125 zp:1 e:63 A:3 H:3 mH:3 rdy:False ex +snowflipperpenguin ICC_023 zp:1 e:63 A:1 H:1 mH:1 rdy:False ex +snowflipperpenguin ICC_023 zp:2 e:67 A:1 H:1 mH:1 rdy:False ex Own Handcards: pos 1 sightlessranger 5 entity 13 TRL_020 0 0 0 Enemy cards: 3 diff --git a/Chuck.SilverFish.Test/RushTest.cs b/Chuck.SilverFish.Test/RushTest.cs index 125ee779..89a01318 100644 --- a/Chuck.SilverFish.Test/RushTest.cs +++ b/Chuck.SilverFish.Test/RushTest.cs @@ -15,7 +15,7 @@ public void Test() //Console.WriteLine(data); Ai ai = Ai.Instance; - ai.autoTester(true, data, 0); + ai.autoTester(true, data, 2); } } } diff --git a/DefaultRoutine/Chuck.SilverFish/ai/MiniSimulator.cs b/DefaultRoutine/Chuck.SilverFish/ai/MiniSimulator.cs index d1e83bc3..bc01631d 100644 --- a/DefaultRoutine/Chuck.SilverFish/ai/MiniSimulator.cs +++ b/DefaultRoutine/Chuck.SilverFish/ai/MiniSimulator.cs @@ -145,7 +145,10 @@ public float DoAllMoves(Playfield playf) foreach (Playfield p in temp) { - if (totalboards > 0) calculated += p.nextPlayfields.Count; + if (totalboards > 0) + { + calculated += p.nextPlayfields.Count; + } if (calculated <= totalboards) { posmoves.AddRange(p.nextPlayfields); @@ -160,7 +163,10 @@ public float DoAllMoves(Playfield playf) bestold = p; bestoldDuplicates.Clear(); } - else if (pVal == bestoldval) bestoldDuplicates.Add(p); + else if (Math.Abs(pVal - bestoldval) < 0.001f) + { + bestoldDuplicates.Add(p); + } } if (isLethalCheck && bestoldval >= 10000) @@ -422,10 +428,9 @@ public void cuttingposibilities(bool isLethalCheck) int i; int max = Math.Min(posmoves.Count, maxwide); - Playfield playfield; for (i = 0; i < max; i++) { - playfield = posmoves[i]; + var playfield = posmoves[i]; var hash = playfield.GetPHash(); playfield.hashcode = hash; if (!tempDict.ContainsKey(hash))