diff --git a/main.go b/main.go index 98cee72..87e8bb1 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,7 @@ const ( type gol struct { grid [ROW][COL]int buffer [ROW][COL]int + step int } // Create array that holds field's to check for neighbours @@ -75,6 +76,7 @@ func (g gol) Life() tea.Model { } } g.grid = g.buffer + g.step++ return g } @@ -95,7 +97,7 @@ func (g gol) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // Let's draw this all simply func (g gol) View() string { - var s string + s := fmt.Sprintf("Step: %d\n", g.step) // Making sure to not draw the empty field around the array for i := 1; i < ROW-1; i++ { for j := 1; j < COL-1; j++ {