rotate board on output
This commit is contained in:
parent
209a4f5caf
commit
7558da5c8e
10
api.go
10
api.go
@ -81,7 +81,15 @@ func (a *API) GetGame(res http.ResponseWriter, req *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.Println("sending game state")
|
log.Println("sending game state")
|
||||||
respondWithJSON(res, http.StatusOK, gameResp{s.getBoard(p)})
|
rotatedBoard := s.getBoard(p)
|
||||||
|
i := 0
|
||||||
|
temp := rotatedBoard[0]
|
||||||
|
for ; i < len(rotatedBoard)-1; i++ {
|
||||||
|
rotatedBoard[i] = rotatedBoard[i+1]
|
||||||
|
}
|
||||||
|
|
||||||
|
rotatedBoard[i] = temp
|
||||||
|
respondWithJSON(res, http.StatusOK, rotatedBoard)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user