GithubHelp home page GithubHelp logo

connect4's Introduction

Connect 4

Connect 4 with a twist: Instead, of playing someone directly write a program to play for you. This repository is the client for the computer player(s) you will build. See the live client here: http://connect4.surge.sh

How to Play

  1. Code up a server that accepts a POST with JSON in this form:
{
  "moves": [0, 1, 2, 3]
}
  1. And returns JSON in this form:
{
  "nextMove": 4,
  "message": "That that!" // optional
}
  1. Then, enter the full URLs for the programs you'd like to play each other and press the "Start Game" button!

Tips and Tricks

  • A "move" is a number 0-6. 0 for the leftmost column and 6 for the rightmost.
  • The first player to move is always player 1.
  • You'll probably want to transform the list of moves into some type of board object so your program can easily reason about it.
  • Don't make any illegal moves! You'll lose.
  • Don't forget about CORS.
  • Want to see a game without coding anything? Enter the word random into the URL input.

Running the Client Locally

  1. git clone [email protected]:bradenhs/connect4.git
  2. cd connect4
  3. npm install
  4. npm start
  5. it should be running in dev mode (live reload enabled, tests running, etc.) at http://localhost:8080

If you'd like to see a simple working server checkout src/computers/random.ts. Run it with this command: npm run random-computer

connect4's People

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.