Giter Club home page Giter Club logo

chomp-game's Introduction

Chompy - (Chomp Game)

Chomp is a two-player strategy game played on a rectangular chocolate bar made up of smaller square blocks (cells). The players take it in turns to choose one block and "eat it" (remove from the board), together with those that are below it and to its right. The top left block is "poisoned" and the player who eats this loses.

Chomp is a special case of a poset game where the partially ordered set on which the game is played is a product of total orders with the minimal element (poisonous block) removed.

Example game

This is the initial state

     0 1 2 3 4 5
    ------------
 0 | p c c c c c
 1 | c c c c c c
 2 | c c c c c c
 3 | c c c c c c

Player 1 move 3,5

     0 1 2 3 4 5
    ------------
 0 | p c c c c c
 1 | c c c c c c
 2 | c c c c c c
 3 | c c c c c x

Player 2 move 0,2

     0 1 2 3 4 5
    ------------
 0 | p c x x x x
 1 | c c x x x x
 2 | c c x x x x
 3 | c c x x x x

Player 1 move 2,0

     0 1 2 3 4 5
    ------------
 0 | p c x x x x
 1 | c c x x x x
 2 | x x x x x x
 3 | x x x x x x

Player 2 move 0,1

     0 1 2 3 4 5
    ------------
 0 | p x x x x x
 1 | c x x x x x
 2 | x x x x x x
 3 | x x x x x x

Player 1 move 1,0

     0 1 2 3 4 5
    ------------
 0 | p x x x x x
 1 | x x x x x x
 2 | x x x x x x
 3 | x x x x x x

Game Over! Player 1 won this game!

Source: Chomp

chomp-game's People

Contributors

kadartamascsaba avatar

Watchers

 avatar Elijah Boateng 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.