Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.13 KB

ReadMe.md

File metadata and controls

41 lines (26 loc) · 1.13 KB

Connect 4 Versions

The game has two versions

  • version 1: two human players play against each other
  • version 2: human player plays against AI

The AI version is implemented with two versions

  • version 1: AI chooses a random place to put its piece
  • version 2: AI put its piece after applying MINIMAX algorithm

How to play the Connect4 game

1 - activate the virtual environment first

  cd pygame_connect4 
  Scripts/activate
  cd .. 
  cd Connect4

2 - choose the playing version

  - To play the game with both versions and switch between them by pressing key C
    py main.py

  - To run connect 4 with 2-human players version ONLY 
    py 2_players_version.py

  - To run connect 4 with AI version ONLY
    py AI_vs_human_version.py

3 - to use keys correctly

   C  to change the game mode from "player vs player" to "player vs AI" and vice versa
   L  to change AI_level from "minimax algorithm" to "random choice"
   R  to restart the game 

Resources for the game code

Connect4 Game