|
|
@@ -58,11 +58,11 @@ func (b *Board) String() string {
|
|
|
|
|
|
func (b *Board) WriteJSON(w io.Writer, startCol, startRow, cols, rows int) {
|
|
|
sc, sr, cols, rows := sanitizeViewPort(b, startCol, startRow, cols, rows)
|
|
|
- fmt.Fprintf(w, "{\"x\"=%v,\"y\"=%v,\"rows\"=%v,\"cols\"=%v,\"tiles\"=[", sc, sr, cols, rows)
|
|
|
+ fmt.Fprintf(w, "{\"x\":%v,\"y\":%v,\"rows\":%v,\"cols\":%v,\"tiles\":[", sc, sr, cols, rows)
|
|
|
|
|
|
for y := startRow; y < sr+rows; y++ {
|
|
|
for x := startCol; x < sc+cols; x++ {
|
|
|
- if (x != startCol) {
|
|
|
+ if (!(x == startCol && y == startRow)) {
|
|
|
w.Write([]byte{','})
|
|
|
}
|
|
|
t := &jsonTile{x, y, b.Get(x, y).Name(), ""}
|