From 731e5166867c35afa85be8aad8f0f3c1dc0f85b9 Mon Sep 17 00:00:00 2001 From: hanemile Date: Sun, 28 Oct 2018 02:34:21 +0100 Subject: Adding all the game files --- structs/structs.go | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 structs/structs.go (limited to 'structs/structs.go') diff --git a/structs/structs.go b/structs/structs.go new file mode 100644 index 0000000..b4ce0e6 --- /dev/null +++ b/structs/structs.go @@ -0,0 +1,51 @@ +package structs + +import "fmt" + +type Lab struct { + Arr [5][5]int +} + +type Coord struct { + X, Y int +} + +func (lab *Lab) Foward(pos Coord) *Lab { + lab.Arr[pos.X][pos.Y] = 0 + lab.Arr[pos.X][pos.Y + 1] = 1 + + fmt.Println(pos.X) + fmt.Println(pos.Y + 1) + + return lab +} + +func (lab *Lab) Backwards(pos Coord) *Lab { + lab.Arr[pos.X][pos.Y] = 0 + lab.Arr[pos.X][pos.Y + 1] = 1 + + fmt.Println(pos.X) + fmt.Println(pos.Y + 1) + + return lab +} + +func (lab *Lab) Left(pos Coord) *Lab { + lab.Arr[pos.X][pos.Y] = 0 + lab.Arr[pos.X][pos.Y + 1] = 1 + + fmt.Println(pos.X) + fmt.Println(pos.Y + 1) + + return lab +} + +func (lab *Lab) Right(pos Coord) *Lab { + lab.Arr[pos.X][pos.Y] = 0 + lab.Arr[pos.X+1][pos.Y] = 1 + + fmt.Println(pos.X) + fmt.Println(pos.Y + 1) + + return lab +} -- cgit 1.4.1