From f2c3cfd8913a0fd64e8f27d9fc0865f774ef5fd6 Mon Sep 17 00:00:00 2001 From: Sacha Ligthert Date: Mon, 6 Nov 2023 22:36:47 +0100 Subject: [PATCH] Use more annoying names --- snake.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/snake.go b/snake.go index 5bd1159..082a8c4 100644 --- a/snake.go +++ b/snake.go @@ -1,8 +1,9 @@ package main import ( - "github.com/gdamore/tcell/v2" "log" + + "github.com/gdamore/tcell/v2" ) func drawText(s tcell.Screen, x1, y1, x2, y2 int, style tcell.Style, text string) { @@ -58,9 +59,8 @@ func drawBox(s tcell.Screen, x1, y1, x2, y2 int, style tcell.Style, text string) } func main() { - // info, err := tcell.LookupTerminfo(os.Getenv("TERM")) - defStyle := tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset) - //boxStyle := tcell.StyleDefault.Foreground(tcell.ColorWhite).Background(tcell.ColorPurple) + + defaultStyle := tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset) var err error @@ -77,7 +77,7 @@ func main() { screen.Clear() - drawBox(screen, 0, 0, x-1, y-1, defStyle, "There should be worms here!") + drawBox(screen, 0, 0, x-1, y-1, defaultStyle, "There should be worms here!") quit := func() { // You have to catch panics in a defer, clean up, and @@ -97,7 +97,7 @@ func main() { switch ev := ev.(type) { case *tcell.EventResize: x, y := screen.Size() - drawBox(screen, 0, 0, x-1, y-1, defStyle, "There should be worms here!") + drawBox(screen, 0, 0, x-1, y-1, defaultStyle, "There should be worms here!") screen.Sync() case *tcell.EventKey: //fmt.Println("Key: ",ev.Rune())