GithubHelp home page GithubHelp logo

quadratum-core's Introduction

Quadratum Core Library

An open source library for the game "Quadratum".

The library currently includes:

  • game logic
  • bot logic

What is Quadratum?

Quadratum is an Android game. The game takes place on a 8x8 board. The object of the game is to form squares using the arrangement of these pieces. The larger the square, the more points the player gets.

In order to win the game you must satisfy the following conditions:

  1. You must have at least 150 points.
  2. And you must at least be 15 points ahead of your opponent.

Usage

The usage of the library is very simple. Start with the following example:

// Initialize the game:

Player player1 = new Player("player1");
Player player2 = new Player("player2");

GameBoard gameBoard = new GameBoard(player1, player2);
gameBoard.addGameBoardListener(boardListener);

HumanPlayerLogic playerLogic1 = new HumanPlayerLogic(player1);
HumanPlayerLogic playerLogic2 = new HumanPlayerLogic(player2);

GameLogic gameLogic = new GameLogic(gameBoard, playerLogic1, playerLogic2);
gameLogic.addGameLogicListener(logicListener);

// Start the game:

gameLogic.startGame(player1);

// Play the game:

playerLogic1.placePiece(1);

playerLogic2.placePiece(40);

Write your own bot logic

If you want to write your own bot logic, you can implement the interface IPlayerLogic.

public interface IPlayerLogic {

  Player getPlayer();

  void requestMove(IReadOnlyGameBoard gameBoard, ILogicCallback callback);

}

If you want to learn how to do that, take a look at the class BotPlayerLogic.

quadratum-core's People

Contributors

tbressler 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.