Ver código fonte

Fixed board syntax

Ronald Peterson 10 anos atrás
pai
commit
a489ce6dc5
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      board/board.go

+ 2 - 2
board/board.go

@@ -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(), ""}