Giter Club home page Giter Club logo

connect4's Introduction

Connect 4™ Game

A simple game where you play Connect 4™ against yourself

WORK IN PROGRESS

LOG

21 May 2019

  • OO design Connect 4 MVP
  • Plan coding process
  • Follow plan

23 May 2019

  • Make DOM update in response to chip drops

25 May 2019

  • Write function to determine if winner

26 May 2019

  • Provide move feedback in DOM

27 May 2019

  • Fix double addToken after game reset bug
    • Two instances of board exist
  • Handle overfill of column
  • Tweak design

28 May 2019

  • Refactor scripts

Objects + Properties

  • The Connect 4 board is 7 spaces wide and 6 spaces high

  • The player’s token must fall to the bottom of the column they place it into

  • You cannot play into a full column

  • You win by getting 4 tokens in a row (horizontal, vertical, diagonal)

  • How cool would it be to program a computer player using artificial inteligence

  • Animations, drag and drop, or other advanced UX could also be fun additions

    Object Properties
    Player represented by token
    two unique players/game
    choses column for drop
    Board matrix? 7x6
    knows token locations
    prevents column overfill
    determines winner
    can reset

Project Plan

Build underlying functionality

  • Create newBoard function that creates 7x6 matrix populated with 0s
  • Write function findRow to find first empty row in given column
  • Create addToken function that adds token to board given column, player, and row
  • Create turn function that provides provides player turn?
  • Write function to determine if win exists

Build web page interface with game functionality

  • Build board representation probably with divs with ids
  • Represent empty board by default
  • Change affected cells using css
  • Maybe allow user to click column button to place token
  • Provide messaging
    • Start new game?
    • Player 1/2
    • ___ WIns!
  • hyperlink to repository?

Stretch

  • Make more responsive design
    • Mobile... second...
  • Build DOM with Javascript to allow different board sizes
  • Drag & drop tokens
  • Build AI player

connect4's People

Contributors

kelceywilson avatar

Watchers

James Cloos avatar  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.