Fix up the tile print now that the radar returns objects

This commit is contained in:
Marc Di Luzio 2020-07-03 17:05:31 +01:00
parent 062f9cfec8
commit c4b0762ebe
2 changed files with 20 additions and 20 deletions

View file

@ -4,7 +4,6 @@ import (
"bufio"
"fmt"
"log"
"math"
"math/rand"
"os"
"sync"
@ -425,24 +424,6 @@ func (w *World) ExecuteCommand(c *Command, rover string) (err error) {
return
}
// PrintTiles simply prints the input tiles directly for debug
func PrintTiles(tiles []byte) {
num := int(math.Sqrt(float64(len(tiles))))
for j := num - 1; j >= 0; j-- {
for i := 0; i < num; i++ {
t := tiles[i+num*j]
if t != 0 {
fmt.Printf("%c", t)
} else {
fmt.Printf(" ")
}
}
fmt.Print("\n")
}
}
// RLock read locks the world
func (w *World) RLock() {
w.worldMutex.RLock()