Git Product home page Git Product logo

reversiai's Introduction

ReversiAI

CI codecov

Brief Description

A Reversi game with an AI implementation that uses minimax with alphabeta pruning and different heuristics to play.

Made for the course TKT20010 at the University of Helsinki.

The project test coverage can be checked at the top of the readme where it says codecov

Key Features

  • AI Opponent: Face off against an AI adversary with advanced decision-making capabilities.
  • Comprehensive Testing: Thorough test coverage ensures robustness and reliability.
  • Extensive Documentation: Detailed documentation provides insights into project specifications, implementation details, and gameplay instructions.

Documentation

  • Project Specification: Details regarding project description, data sctructures, etc.
  • Manual/Instructions: How to install and run the game, how to play Reversi/Othello and modify the difficulty.
  • Testing: What is being tested, and how to replicate the tests.
  • Implementation: How the project was implemented and other details.

Weekly Reports

Track the progress and development of the project through weekly reports:

Instructions

You can check a more detailed version in the Manual/Instructions.

  1. Clone the repo and then access the directory
git clone https://github.com/LittleHaku/ReversiAI/
  1. Install poetry, skip if you already have it
make install_poetry

or

curl -sSL https://install.python-poetry.org | python3 -
  1. Install dependencies
make dependencies
  1. Run the game
make play

reversiai's People

Contributors

littlehaku avatar

Stargazers

 avatar

Watchers

 avatar

reversiai's Issues

Peer review week 5

Hello,
In total this software looks pretty good at the moment, although I'm not familiar with the game before.

Good things about user interface:
I generally like the look of the pieces. Immediately understand the situation on the board. Easy and simple. I also like how game shows who wins at the end. I really much like how closing the game asks you to confirm if you really want to close the game. I also maybe have to put this in my own work.

What I would improve in the user interface:
I would make the game window at least twice as big. I think it's a bit too small at the moment. But this is only my opinion.
I would also make separate buttons in the window for closing the game and restarting the game.

Good things about the code:
The code is clear and easy to understand
The minimax algorithm seems to work correctly. Nice job with that.

I can't say anything bad in the code. Looks fine to me.

One more thing is, I couldn't start game with command 'make play'. It says some python version error but I think my python version 3.8 is just outdated. It would probably be good to put in the manual, which version you need to have.

Peer review of the ReversiAI game code

source code cloned: 13.10.2023 at about 17:00

newest commit at the time of cloning:

Thu Oct 12 13:58:14 2023 +0300

These comments are mostly more about the technical quality of the source code rather than the architecture of the prorgram architecture or the quality of the algorithms.

improvement suggestion 1

Testing: The logic engine is pretty thoroughly tested, but perhaps a bit more "weird" test cases?

improvement suggestion 2

The GUI and the game logic, and also the test cases could be split into several classes, each with only related functionality. Now, all GUI code is in one file, all logic code is in one file, and all test cases are in one file. This doesn't seem like a good approach, as the program grows in complexity.

improvement suggestion 3

There seems to be some "magic numbers" in the code. For example:

    def handle_click(self, event):
        col = event.x // 50
        row = event.y // 50

Where does this number 50 come from? What does it represent? Pixel values or something else? Renaming it to PIXELS_PER_SQUARE (or some such) could improve readability of the code.

improvement suggestion 4

The code seems to be pretty procedural. The GUI could perhaps better be implemented as an event-driven architecture, simplifying the code.

General comments about the code

The code seems nicely formatted and is pretty idiomatic Python.

General comments about the GUI

The GUI seems quite OK. The game is playable, and this tester lost to the AI by quite a margin. It would be nice if the game board would get larger as one increased the window size. At the moment the window is resizable but resizing the window only adds margins outside the board.

General comments about testing (test cases)

The logic engine seems pretty thoroughly tested, and I especially liked that the test cases source code did include quite a lot of inline comments.

General comments about game logic

The logic seems to be quite sound. I would have liked more inline comments explaining what the code does. Otherwise, good job!

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.