Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/max_word_count/max_word_count.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func main() {
var bestBoard boggle.Board
var bestBoardCount = 0

for _ = range 100_000 {
for range 100_000 {
b := boggle.Shake(boggle.ClassicDice)
boardWordsDict := b.AllWords(dict)
// fmt.Println(boardWordsDict.Size())
Expand Down
14 changes: 9 additions & 5 deletions cmd/playable_words/playable_words.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,27 @@ import (

func main() {
unfiltered := dictionary.Map{}
dictionary.Load(dictionary.CSW19, unfiltered)
if err := dictionary.Load(dictionary.CSW19, unfiltered); err != nil {
panic(err)
}

sizePlayable, _ := filter(unfiltered, boggle.Playable)
// fmt.Printf("Excluded for size: %v\n", sizeExcluded)
classicPlayable := evaluate(sizePlayable, boggle.ClassicDice)
newPlayable := evaluate(sizePlayable, boggle.NewDice)

onlyClassic := filterExclusive(classicPlayable, newPlayable)
// fmt.Printf("Only classic-playable:\n %+v\n", onlyClassic)
onlyNew := filterExclusive(newPlayable, classicPlayable)

fucklike, _ := filterSlice(onlyClassic, func(word string) bool {
return strings.ContainsRune(word, 'f') && strings.ContainsRune(word, 'k')
})
fmt.Printf("%d/%d Classic-exclusive words contain 'f' and 'k'", fucklike.Size(), len(onlyClassic))

// onlyNew := filterExclusive(newPlayable, classicPlayable)
// fmt.Printf("Only new-playable:\n %+v\n", onlyNew)
fmt.Printf("Classic playable: %d\n", classicPlayable.Size())
fmt.Printf("New playable: %d\n", newPlayable.Size())
fmt.Printf("Only classic: %d\n", len(onlyClassic))
fmt.Printf("Only new: %d\n", len(onlyNew))
fmt.Printf("%d/%d Classic-exclusive words contain 'f' and 'k'\n", fucklike.Size(), len(onlyClassic))
}

func evaluate(sizePlayable dictionary.Map, dice [16]boggle.Die) dictionary.Map {
Expand Down
12 changes: 4 additions & 8 deletions cmd/sameness/sameness.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
func main() {
classicUniqueCounts := []string{}
newUniqueCounts := []string{}
for _ = range 1_000 {
for range 1_000 {
classicUnique, _ := evaluate(boggle.ClassicDice)
classicUniqueCounts = append(classicUniqueCounts, strconv.Itoa(classicUnique))
newUnique, _ := evaluate(boggle.NewDice)
Expand All @@ -40,16 +40,12 @@ func evaluate(dice [16]boggle.Die) (unique, common int) {

wordCounts := map[string]int{}

for _ = range GamesPerSession {
b := boggle.Shake(boggle.ClassicDice)
for range GamesPerSession {
b := boggle.Shake(dice)
boardWordsDict := b.AllWords(dict)

for _, word := range boardWordsDict.Members() {
if _, ok := wordCounts[word]; ok {
wordCounts[word]++
} else {
wordCounts[word] = 1
}
wordCounts[word]++
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/word_counts/word_counts.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func main() {
log.Fatal(err.Error())
}

for _ = range 10_000 {
for range 10_000 {
b := boggle.Shake(boggle.ClassicDice)
boardWordsDict := b.AllWords(dict)
fmt.Println(boardWordsDict.Size())
Expand Down
2 changes: 1 addition & 1 deletion pkg/boggle/die.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var (
newDie7 = newDie{"d", "e", "l", "r", "v", "y"}
newDie8 = newDie{"d", "i", "s", "t", "t", "y"}
newDie9 = newDie{"e", "e", "g", "h", "n", "w"}
newDie10 = newDie{"e", "e", "i", "n", "s", "v"}
newDie10 = newDie{"e", "e", "i", "n", "s", "u"}
newDie11 = newDie{"e", "h", "r", "t", "v", "w"}
newDie12 = newDie{"e", "i", "o", "s", "s", "t"}
newDie13 = newDie{"e", "l", "r", "t", "t", "y"}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dictionary/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (d Map) CanBePrefix(pre string) bool {

func (d Map) Members() []string {
result := make([]string, 0, len(d))
for word, _ := range d {
for word := range d {
result = append(result, word)
}
return result
Expand Down
2 changes: 1 addition & 1 deletion pkg/game/tea.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func Run(

finalModel := final.(model)
scoredWords := make([]string, 0, len(finalModel.scoredWords))
for word, _ := range finalModel.scoredWords {
for word := range finalModel.scoredWords {
scoredWords = append(scoredWords, word)
}
return scoredWords, nil
Expand Down
Loading