Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chucklu committed Sep 17, 2019
1 parent 3c95507 commit b345204
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Chuck.SilverFish.Test/Data/RushTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Chuck.SilverFish.Test/RushTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void Test()
//Console.WriteLine(data);

Ai ai = Ai.Instance;
ai.autoTester(true, data, 0);
ai.autoTester(true, data, 2);
}
}
}
13 changes: 9 additions & 4 deletions DefaultRoutine/Chuck.SilverFish/ai/MiniSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit b345204

Please sign in to comment.