ソースを参照

Use more annoying names

Sacha Ligthert 2 年 前
コミット
f2c3cfd891
1 ファイル変更6 行追加6 行削除
  1. 6 6
      snake.go

+ 6 - 6
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())