Skip to content

Re:zero is a web application that can play Reversi against AI based on the AlphaZero (AZ) algorithm.

License

Notifications You must be signed in to change notification settings

1ncursio/re-zero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Re:zero

Re:zero is a web application that can play Reversi against AI based on the AlphaZero (AZ) algorithm.

Note: Re:zero is a work in progress. In the future, Re:zero will be able to play against other players.

Features

  • Play against AZ
  • You can also write posts and comments on the community

System Architecture

Neural Network Architecture

Folder Structure

.
├── alphazero                   # AlphaZero
│   ├── app.py                  # Flask application (no longer used)
│   ├── dual_network.py         # Dual network that outputs the policy and value using ResNet
│   ├── evaluate_best_player.py # Evaluate the best player
│   ├── evaluate_network.py     # Evaluate the network
│   ├── game.py                 # Reversi game logic
│   ├── human_play.py           # Human play
│   ├── pv_mcts.py              # PV MCTS algorithm
│   ├── self_play.py            # Self play
│   ├── train_cycle.py          # Train cycle
│   ├── train_network.py        # Train network
│   └── model                   # Trained best model
│       └── best.h5
│
├── server                      # Laravel server
│   └── ...
├── webapp                      # Next.js web application
│   ├── public                  # Static files
│   │   └── assets              # Next.js assets
│   ├── components          # Next.js components
│   ├── lib
│   │   ├── api             # Ajax calls to the server
│   │   ├── othello         # Reversi game logic for the webapp
│   │   └── ...
│   ├── pages               # Next.js pages
│   ├── store               # Zustand store (Does not used yet)
│   ├── hooks               # Next.js hooks
│   ├── typings             # type definitions
│   └── ...
└── README.md

Built With

Frontend

Backend

AlphaZero

Getting Started

This is an example of how you may give instructions on setting up Re:zero locally. To get a local copy up and running follow these simple example steps.

Prerequisites

  • Node.js (version >= 14.x)
  • PHP (version >= 8.1)
  • Python (version >= 3.9)
  • Yarn (version >= 1.22) (recommended)

Installation

  1. Clone the repository
git clone https://github.com/1ncursio/laravel-othello.git
  1. Install NPM dependencies for the frontend
cd laravel-othello/webapp
yarn install
  1. Run the frontend server
yarn dev
  1. Install Composer dependencies for the backend
cd laravel-othello/server
composer require
  1. Migrate the database
php artisan migrate
  1. Copy .env.example to .env and fill in the required values
cp .env.example .env
  1. Run the backend server
php artisan serve

Then open your browser and navigate to http://localhost:3000/

Future Plans

  • Refactor the code to use the Zustand
  • Write tests
  • Deploy the project
  • Implement multi-player mode
  • Migrate Backend Framework (e.g. Nest.js, fastify, django, etc.)
  • Support i18n
  • Support PWA
  • Implement Scalable Game Board (e.g. 6x6, 8x8, 10x10, etc.)

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Linkedin Badge Gmail Badge