-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.go
53 lines (40 loc) · 1.43 KB
/
input.go
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"flag"
"fmt"
)
var (
seed string
randomSeed int
)
func readInputs() {
scaleFlag := flag.String("scale", "default", "Scale for board: macro, large, default, small, micro")
// Load known shape from seed list
seedFlag := flag.String("seed", "", "A known seed: blinker, toad, glider")
// Set how much rain to use
rainFlag := flag.Int("rain", 0, "Generate random rain each iteration, set number of drops here")
rainIntervalFlag := flag.Int("interval", 1, "Generate rain every Cycle % X == 0 frames")
sharpFlag := flag.Bool("sharp", false, "Sharp mode disables rendering of tiles with less than 2 neighbors")
// Add first generation as random bits
initFlag := flag.Int("init", GEN1, "Initial random population")
// Set milliseconds of delay in render
delayFlag := flag.Int("delay", 200, "Milliseconds per frame delay")
soundFlag := flag.Bool("sound", false, "Play some algorthmic sound with rendering")
flag.Parse()
fmt.Printf("Seed: %s, Rain: %d, Delay: %d, Init: %d\n", *seedFlag, *rainFlag, *delayFlag, *initFlag)
scale := scales[*scaleFlag]
B = scale.B
Bm := B / 4
Vi = 0 + Bm
Vm = B - Bm
tileSize = scale.tileSize
tileMargin = scale.tileMargin
fmt.Printf("B: %d, Vi: %d, Vm: %d, tileSize: %d, tileMargin: %d\n", B, Vi, Vm, tileSize, tileMargin)
randomSeed = *initFlag
seed = *seedFlag
rain = *rainFlag
rainInterval = *rainIntervalFlag
sharp = *sharpFlag
delay = *delayFlag
sound = *soundFlag
}