Skip to content

Commit

Permalink
Bug fix on char frequency strat, handle fewer ranked words.
Browse files Browse the repository at this point in the history
  • Loading branch information
archy-bold committed Jan 6, 2022
1 parent 40c3b42 commit 57c980d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions strategy/charfrequency.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ func (s *CharFrequencyStrategy) SetMoveOutcome(row []game.GridCell) {

// GetSuggestions will get the best n suggestions given the current state
func (s *CharFrequencyStrategy) GetSuggestions(n int) PairList {
if n >= len(s.rankedWords) {
n = len(s.rankedWords) - 1
}
return s.rankedWords[0:n]
}

Expand Down

0 comments on commit 57c980d

Please sign in to comment.