diff options
| author | Brandon C. Irizarry <brandon.irizarry@gmail.com> | 2026-03-05 20:37:17 -0500 |
|---|---|---|
| committer | Brandon C. Irizarry <brandon.irizarry@gmail.com> | 2026-03-05 20:37:17 -0500 |
| commit | f63b838924a348ecacb9bf61a80276fd77dc59d4 (patch) | |
| tree | ec129102485ac3d89e7badba07f219b84366ce93 /main.go | |
chore: initialize project
This program shows the "non-seeded" behavior of a given rand function.
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -0,0 +1,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) + } +} |
