mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-09-16 05:36:10 +00:00
Switch buffer contents to string slice
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user