Coder Social home page Coder Social logo

connect4's Introduction

Connect4 Game Playing Agent

Game Playing Agent for the popular two player board game Connect4 in Java

###Description Connect 4 involves two players, a ‘red’ player and a ‘yellow’ player, playing against each other. The game is played on a vertical grid with six rows and seven columns. The players take turns placing pieces of their color, called ‘tokens’, into the board. The goal of each player is to get four of his or her tokens in a row in the board, either horizontally, vertically, or diagonally.

###Project Architecture

  • Main.java: the main driver class.
  • Connect4Game.java: the object that stores the current status of the game. Connect4Game stores the game board as a list of Connect4Columns.
  • Connect4Column.java: the object that stores a single column of the game board. A Connect4Column stores a list of Connect4Slots, from the top to the bottom. The first slot in the list is the top slot, and the last slot is the bottom slot.
  • Connect4Slot.java: the object that stores a single slot in the game board. A slot can be either filled by a token or empty; if a slot is empty, no other slots above it can be filled. If a slot is filled, it is filled by either a red token or a yellow one.
  • Agent.java: the abstract class that gives the actions that every agent must be able to perform. Generally, every agent must have a name and must be able to move in the game.
  • Connect4Frame.java: the class that creates the window that shows the game. The Connect4Frame object also runs the game engine.
  • Connect4Panel.java: the class that shows the current game itself.
  • Varun.java: this class is the subclass of Agent.java, and all the logic of the agent that plays this game is implemented in this class.

###UML Diagram

###ScreenShot

connect4's People

Contributors

sharma-varun 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.