Switch buffer contents to string slice

This commit is contained in:
2026-03-19 11:53:01 +02:00
parent 1b5ce6b7f8
commit 2bf960b085
6 changed files with 514 additions and 541 deletions
+24
View File
@@ -0,0 +1,24 @@
package main
type Position struct {
X int
Y int
}
func (position *Position) Equals(x, y int) bool {
return position.X == x && position.Y == y
}
func ComparePositions(pos1, pos2 Position) int {
if pos1.Y < pos2.Y {
return -1
} else if pos1.Y > pos2.Y {
return 1
} else if pos1.X < pos2.X {
return -1
} else if pos1.X > pos2.X {
return 1
} else {
return 0
}
}