Giter Site home page Giter Site logo

tic-tac-toe-api's Introduction

tic-tac-toe-api

Summary

tic-tac-toe-api is an api service that exposes an endpoint that will always calculate the best move for a given a game state.

How to Run Locally

  • Prerequisites:

    1. ✔ go go1.16.6 darwin/amd64. brew install golang
  • Running:

    1. ✔ Clone this project: git clone https://github.com/cosbor11/tic-tac-toe-api.git
    2. ✔ Navigate to the root of the project cd tic-tac-toe-api
    3. ✔ run go build to install the dependencies
    4. ✔ run: go run server.go to launch the application on localhost:5500
  • User Interface:

Endpoints

  • POST /next-move:

Example Request:

curl --location --request POST 'http://localhost:5500/next-move' \
--header 'Content-Type: application/json' \
--data-raw '{
    "player": "O",
    "moves": [{
        "player": "X",
        "cell": "A1"
    },{
        "player": "O",
        "cell": "B3"
    }]
}'

Example Response:

{
    "player": "O",
    "cell": "A2"
}

@author Chris Osborn

tic-tac-toe-api's People

Contributors

cosbor11 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.