blob: b4ce0e6372168923087fbf51cea1d241783c5168 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
}
|