Skip to content

Commit

Permalink
made points more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
OliBomby committed Nov 25, 2022
1 parent f411209 commit 567f3f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions SpellCastSolverLib/LetterState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ public LetterState(char letter, int pointsMultiplier = 1, int multiplier = 1, bo
{ 'g', 3 },
{ 'h', 4 },
{ 'i', 1 },
{ 'j', 7 },//
{ 'j', 7 },
{ 'k', 5 },//
{ 'l', 3 },
{ 'm', 4 },//
{ 'm', 4 },
{ 'n', 2 },
{ 'o', 1 },
{ 'p', 4 },//
{ 'q', 8 },
{ 'r', 2 },
{ 's', 2 },//
{ 's', 2 },
{ 't', 2 },
{ 'u', 4 },
{ 'v', 5 },//
{ 'w', 5 },
{ 'x', 7 },
{ 'y', 7 },//
{ 'z', 7 }//
{ 'y', 4 },
{ 'z', 8 }
};
}
2 changes: 1 addition & 1 deletion SpellCastSolverLib/Solver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ IEnumerable<SolveResult> TryResult(char c, int m, int p, int g, int sw) {
string matchWord = words[match];
// Create result if the whole word is matched
if (word.Length == matchWord.Length) {
yield return new SolveResult(words[match], p * m, g, path.ToArray());
yield return new SolveResult(words[match], word.Length > 5 ? p * m + 10 : p * m, g, path.ToArray());
} else {
any = true;
}
Expand Down
4 changes: 2 additions & 2 deletions SpellCastSolverTests/SolverTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void TestSolve() {
var best = results.First();

Assert.AreEqual("outwore", best.Word);
Assert.AreEqual(36, best.Points);
Assert.AreEqual(46, best.Points);
Assert.AreEqual(3, best.Gems);
}

Expand All @@ -27,7 +27,7 @@ public void TestSolveSwaps() {
var best = results.First();

Assert.AreEqual("outworked", best.Word);
Assert.AreEqual(42, best.Points);
Assert.AreEqual(52, best.Points);
Assert.AreEqual(0, best.Gems);
}
}

0 comments on commit 567f3f3

Please sign in to comment.