mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-26 12:01:45 +00:00
prepare displaying game of life grid
This commit is contained in:
parent
b66f12b7c6
commit
80984f8243
14
main.go
14
main.go
@ -1,12 +1,26 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func output(_ *resty.Client, _ string, width, height int, arr [][]Cell) {
|
||||||
|
for i := 0; i < width; i++ {
|
||||||
|
for j := 0; j < height; j++ {
|
||||||
|
if arr[i][j].live {
|
||||||
|
fmt.Printf("█")
|
||||||
|
} else {
|
||||||
|
fmt.Printf(" ")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Printf("\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Load .env file if it exists
|
// Load .env file if it exists
|
||||||
err := godotenv.Load(".env")
|
err := godotenv.Load(".env")
|
||||||
|
Loading…
Reference in New Issue
Block a user