Przeglądaj źródła

Moving a constant between files.

Sacha Ligthert 2 lat temu
rodzic
commit
c5827793ef
2 zmienionych plików z 7 dodań i 7 usunięć
  1. 0 7
      game.go
  2. 7 0
      types.go

+ 0 - 7
game.go

@@ -7,13 +7,6 @@ import (
 	"github.com/gdamore/tcell/v2"
 )
 
-const (
-	Left = iota
-	Right
-	Up
-	Down
-)
-
 func initilize() (tcell.Screen, tcell.Style, error) {
 	style := tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset)
 

+ 7 - 0
types.go

@@ -1,5 +1,12 @@
 package main
 
+const (
+	Left = iota
+	Right
+	Up
+	Down
+)
+
 type Position struct {
 	x int
 	y int