Coder Social home page Coder Social logo

aadarsha2002 / cs340final-connect4 Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 57 KB

Connect4 is a Java board game featuring single player mode against an AI opponent and multiplayer mode for two human players. The AI uses the alpha-beta pruning algorithm. Offers a challenging experience for players of all skill levels.

Java 100.00%
ai algorithm all alpha beta board challenging connect4 experience game java levels mode multiplayer opponent player players pruning single skill

cs340final-connect4's Introduction

Connect4

Connect4 is a classic two-player board game in which players take turns dropping colored discs into a vertically oriented grid. The goal of the game is to be the first player to create a horizontal, vertical, or diagonal line of four of one's own discs. This project is a Java implementation of Connect4, with a focus on creating a challenging and engaging experience for players. It includes features for both single player mode, where the player competes against an AI opponent, and multiplayer mode, where two human players can compete against each other.

Getting Started

To start the game, run the main method. You will be prompted to choose whether you want to play against another human or the AI. If you choose to play against the AI, you will also be asked whether you want to go first. The game is played by alternating turns between the players. During each turn, the player will be prompted to enter a column where they want to place their piece. The game ends when one of the players gets 4 in a row or the board is full.

AI Opponent

The AI opponent uses the alpha-beta pruning algorithm to make strategic and efficient moves. This algorithm is based on the minimax search algorithm, which is used to find the best move in a two-player game by considering all possible moves and countermoves. The alpha-beta pruning algorithm improves upon the minimax algorithm by pruning the search tree to avoid exploring branches that are known to be suboptimal. This makes the algorithm more efficient, as it avoids wasting time and resources on exploring suboptimal branches of the game tree.

Contributions

The base game was developed by Aadarsha Gopala Reddy, and Alex Casper headed the development of the AI opponent. Jose Mancilla played a critical role in the project by finding and reporting bugs in the code. His thorough testing and debugging helped identify and fix many issues with the implementation of the alpha-beta pruning algorithm.

Overall, the project offers an engaging and challenging experience for players of all skill levels. It provides a fun and enjoyable way to play Connect4, with the added challenge of competing against an AI opponent that uses the alpha-beta pruning algorithm to make strategic and efficient moves. The ability to play against another human adds an additional layer of enjoyment and competition, making the project a well-rounded and enjoyable experience for players. However, the algorithm still needs some work, especially in terms of tweaking the evaluation function and the minimax function, in order to make the AI opponent even more challenging and engaging for players. The hard work and dedication of the team has resulted in a successful implementation of the game and its key features, but there is still room for improvement and further development.

cs340final-connect4's People

Contributors

aadarsha2002 avatar adcasper avatar

Watchers

 avatar  avatar

Forkers

adcasper

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.