Documentation ¶
Index ¶
- Constants
- func CreateCreateGameHandler(games map[string]GameDTO, nextUUID func() string, randomElement func(int) int) func(http.ResponseWriter, *http.Request)
- func CreateElementGenerator(rand func() int) func(int) int
- func CreateElementGeneratorArray(rand func() int) func([]int) int
- func CreateGetGameHandler(games map[string]GameDTO) func(http.ResponseWriter, *http.Request)
- func CreateHighScoreHandler(games map[string]GameDTO) func(http.ResponseWriter, *http.Request)
- func CreateMoveHandler(games map[string]GameDTO, randomElement func([]int) int) func(http.ResponseWriter, *http.Request)
- func CreateVersionHandler(version string) func(http.ResponseWriter, *http.Request)
- func EvaluateBoard(arrayBoard []int) (int, []int)
- func Insert(slice []int, element int, index int) []int
- func Max(a int, b int) int
- func ToJsonString(any interface{}) string
- type GameDTO
- type ServerResponse
Constants ¶
View Source
const END_OF_GAME = -1000
View Source
const (
PLUS_SIGN int = 0
)
Variables ¶
This section is empty.
Functions ¶
func CreateCreateGameHandler ¶
func CreateElementGenerator ¶
func CreateGetGameHandler ¶
func CreateHighScoreHandler ¶
func CreateMoveHandler ¶
func CreateVersionHandler ¶
func CreateVersionHandler(version string) func(http.ResponseWriter, *http.Request)
func EvaluateBoard ¶
func ToJsonString ¶
func ToJsonString(any interface{}) string
Types ¶
type GameDTO ¶
type GameDTO struct { Id string `json:"id"` Ip string `json:"ip"` Name string `json:"name,omitempty"` Board []int `json:"board"` Next int `json:"next"` Round int `json:"round"` Score int `json:"score"` InitialBoard []int `json:"initial_borad"` PreviousElements []int `json:"previous_elements"` }
func GetHighScores ¶
type ServerResponse ¶
Click to show internal directories.
Click to hide internal directories.