Initial commit

This commit is contained in:
Ian Gulliver
2023-12-24 17:57:00 -05:00
parent 5b04b9130d
commit cb331a4ed5
8 changed files with 5508 additions and 0 deletions

37
seeds.go Normal file
View File

@@ -0,0 +1,37 @@
package coding
var chatHeap = newHeapFromSeed([][]byte{
[]byte(`]\_}`),
[]byte(`[ê%=Z`),
[]byte(`#ÄQ<>`),
[]byte(`&X@+*`),
[]byte(`$~"V;`),
[]byte(`/78q9`),
[]byte("zRE54F(U-6\n"),
[]byte(`NLx:C01D2BJ)K3GP`),
[]byte(`STWH!OYAjM`),
[]byte(`?,'`),
[]byte(`bIv`),
[]byte(`mygwc.pfk`),
[]byte(`isrhlud`),
[]byte(`eotan`),
[]byte(` `),
})
func ChatHeap() *Heap {
return chatHeap.Clone()
}
func newHeapFromSeed(seed [][]byte) *Heap {
h := NewHeap()
for i := range seed {
for _, s := range seed[i:] {
for _, b := range s {
h.IncrementSymbol(b)
}
}
}
return h
}