inistal commit
This commit is contained in:
commit
023bb97155
7 changed files with 661 additions and 0 deletions
40
cmd/gen_sequence.go
Normal file
40
cmd/gen_sequence.go
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
)
|
||||
|
||||
const (
|
||||
R = 64
|
||||
N = 64
|
||||
)
|
||||
|
||||
func rnd(max int) (r [R*N + 1]uint8) {
|
||||
rn := rand.New(rand.NewSource(0))
|
||||
for i := 0; i < R*N+1; i++ {
|
||||
r[i] = uint8(rn.Intn(max))
|
||||
if i > 1 && r[i-1] == r[i] {
|
||||
r[i] = (r[i] + 1) % N
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("package goxifrat\n")
|
||||
fmt.Println("var rn = [R*N + 1]uint8{")
|
||||
r := rnd(N)
|
||||
for i := 0; i < 128; i++ {
|
||||
fmt.Print(" ")
|
||||
for j := 0; j < 32; j++ {
|
||||
fmt.Printf("%d,", r[i+j])
|
||||
if j < 31 {
|
||||
fmt.Print(" ")
|
||||
}
|
||||
}
|
||||
fmt.Println()
|
||||
}
|
||||
fmt.Printf(" %d,\n", r[4096])
|
||||
fmt.Println("}")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue