Clean up of redundant code.
This commit is contained in:
parent
2543cd8e55
commit
ee47329732
@ -5,18 +5,12 @@ import "strconv"
|
||||
// drawBox Draw the outline of the box the snake can move in
|
||||
func (g *Game) drawBox(game *Game) {
|
||||
|
||||
// Assuming we will always have this
|
||||
x1 := 0
|
||||
y1 := 0
|
||||
x2 := 79
|
||||
y2 := 23
|
||||
|
||||
if y2 < y1 {
|
||||
y1, y2 = y2, y1
|
||||
}
|
||||
if x2 < x1 {
|
||||
x1, x2 = x2, x1
|
||||
}
|
||||
|
||||
// Fill background
|
||||
for row := y1; row <= y2; row++ {
|
||||
for col := x1; col <= x2; col++ {
|
||||
|
Loading…
x
Reference in New Issue
Block a user