Skip to content

Commit

Permalink
Fix Illustrious 18 comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
mhluska committed Aug 29, 2021
1 parent 40f5289 commit 711010c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/hi-lo-deviation-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ export const illustrious18Deviations = new Map<number, Map<number, Illustrious18

export default class HiLoDeviationChecker {
static _suggest(game: Game, hand: Hand): Illustrious18Deviation | undefined {
if (
!game.settings.checkDeviations &&
game.settings.mode !== GameMode.Illustrious18
) {
return;
}

const trueCount = game.shoe.hiLoTrueCount;

if (!game.dealer.upcard || hand.isSoft) {
Expand Down Expand Up @@ -102,6 +95,13 @@ export default class HiLoDeviationChecker {
// Returns false if a deviation was not present.
// Returns an object with a `correctMove` code and a `hint` otherwise.
static check(game: Game, hand: Hand, input: Move): CheckResult | boolean {
if (
!game.settings.checkDeviations &&
game.settings.mode !== GameMode.Illustrious18
) {
return false;
}

const deviation = this._suggest(game, hand);

if (!deviation) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class Utils {
}

static compareRange(number: number, range: [string, number]): boolean {
return range[0] === '>' ? number >= range[1] : number < range[1];
return range[0][0] === '>' ? number >= range[1] : number < range[1];
}

static hiLoValue(cards: Card[]): number {
Expand Down

0 comments on commit 711010c

Please sign in to comment.