Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.65 KB

README.md

File metadata and controls

49 lines (35 loc) · 1.65 KB

Connect4

A Connect4 game in two versions:

  • Static
  • RESTful API

Built with Node.js using the Express framework, JavaScript, HTML and CSS.

Main features developed

Feature Client-Server Static
Place pieces on Connect 4 grid
Respond to click events
Detect victory conditions
Display victory conditions
Display winner
Add Player names and declare the winner

Static version

Hosted in Vercel: connect4-static.vercel.app

Client-Server version

RESTful API with NodeJS using Express.

gameplay gif

Install packages (generate package-lock.json):

  1. Access project's subdirectory:
    cd clientserver/

  2. Install packages:
    npm install

Launch server from command line & start playing

  1. Start server:
    npm start (npm will run node server.js)
    Expected output: "Express server up on port: 8080"

  2. On browser, go to https://localhost:8080

Logic behind takeTurn interaction

  1. [client - grid] EventListener on board grid (listens to "click");
  2. [client - positionClick] Client click action will POST row & column;
  3. [server - taketurn] Server responds with json containing the game’s updated state.

External links

Wikipedia - Connect Four