Skip to content

Commit

Permalink
gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
semi committed Sep 12, 2021
1 parent 6e2e503 commit 667b6ec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var Weight struct {
Score struct {
FSpeed float64
IndexBalance float64
LSB float64
LSB float64

TrigramPrecision int
Roll float64
Expand Down
10 changes: 5 additions & 5 deletions layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ func ListLSBs(l Layout) []FreqPair {
if dist >= 2 {
k1 := l.Keys[p1.Row][p1.Col]
k2 := l.Keys[p2.Row][p2.Col]
list = append(list, FreqPair{k1+k2, float64(Data.Bigrams[k1+k2])})
list = append(list, FreqPair{k2+k1, float64(Data.Bigrams[k2+k1])})
list = append(list, FreqPair{k1 + k2, float64(Data.Bigrams[k1+k2])})
list = append(list, FreqPair{k2 + k1, float64(Data.Bigrams[k2+k1])})
}
}
}
Expand All @@ -594,8 +594,8 @@ func ListLSBs(l Layout) []FreqPair {
if dist >= 2 {
k1 := l.Keys[p1.Row][p1.Col]
k2 := l.Keys[p2.Row][p2.Col]
list = append(list, FreqPair{k1+k2, float64(Data.Bigrams[k1+k2])})
list = append(list, FreqPair{k2+k1, float64(Data.Bigrams[k2+k1])})
list = append(list, FreqPair{k1 + k2, float64(Data.Bigrams[k1+k2])})
list = append(list, FreqPair{k2 + k1, float64(Data.Bigrams[k2+k1])})
}
}
}
Expand Down Expand Up @@ -645,7 +645,7 @@ func staggeredX(c, r int) float64 {
sx = float64(c)
}
return sx
}
}

func twoKeyDist(a, b Pos, weighted bool) float64 {
var ax float64
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func main() {
amount, _ = strconv.Atoi(args[2])
}
PrintFreqList(dsfbs, amount, true)

} else if args[0] == "lsbs" {
if len(args) == 1 {
fmt.Println("You must specify a layout!")
Expand Down
2 changes: 0 additions & 2 deletions output.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func PrintAnalysis(l Layout) {
lsb := float64(LSBs(l))
fmt.Printf("LSBs: %.2f%%\n", 100*lsb/l.Total)


SortFreqList(sfbs)

fmt.Println("Top SFBs:")
Expand All @@ -115,7 +114,6 @@ func PrintAnalysis(l Layout) {
fmt.Println("Worst Bigrams:")
PrintFreqList(bigrams, 8, false)
}


fmt.Printf("Score: %.2f\n", Score(l))
fmt.Println()
Expand Down

0 comments on commit 667b6ec

Please sign in to comment.