blob: 45362f80e5d0f8041c7c23dd5534bfecb140336e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
package main
import (
"fmt"
"image/color"
"io"
"math/rand/v2"
"os"
)
var palette = []color.Color{
color.White,
color.Black,
}
func main() {
lissajous(os.Stdout)
}
func lissajous(out io.Writer) {
const (
cycles = 5
res = 0.001
size = 100
nframes = 64
delay = 8
)
// Note that this generates the exact same random number per
// run of the program.
freq := rand.Float64() * 3.0
for range 10 {
fmt.Printf("random number: %.2f\n", freq)
}
}
|