From f63b838924a348ecacb9bf61a80276fd77dc59d4 Mon Sep 17 00:00:00 2001 From: "Brandon C. Irizarry" Date: Thu, 5 Mar 2026 20:37:17 -0500 Subject: chore: initialize project This program shows the "non-seeded" behavior of a given rand function. --- .gitignore | 1 + go.mod | 3 +++ main.go | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 .gitignore create mode 100644 go.mod create mode 100644 main.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7f2463c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/lissajous diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..2017d36 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.brandonirizarry.xyz/lissajous + +go 1.25.0 diff --git a/main.go b/main.go new file mode 100644 index 0000000..45362f8 --- /dev/null +++ b/main.go @@ -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) + } +} -- cgit v1.2.3