Giter Club home page Giter Club logo

minesweeper_bot's Introduction

minesweeper_bot

A telegram bot of various board games, utilizing its inline keyboard feature.

Source code structure

Each game is factored as "game logic" and "interaction logic":

  • Game logic is the interface-independent part of the game. Think of it this way: it is the part of code that can be reused without change if someone decides to write a Gtk version or TUI version of the game.
  • Interaction logic defines how the game renders itself and responds to input events. For telegram bots, the only user input is a click on a square, and the game responds with an updated inline keyboard and a text message.

Interaction logic is further divided into player control logic and abstract play logic. For example, any two-player competitive board game will need to check if the click event come from the current player, and that part is handled by the player control logic. The abstract play logic can then assume players always make moves in turn.

minesweeper_bot's People

Contributors

tonyxty avatar

Stargazers

nonpolar avatar CRANKV2 avatar Bryan Cruz avatar zbv avatar Khaled Ferjani avatar Lîm Tsú-thuàn avatar Matchy avatar Edward Elric avatar

Watchers

James Cloos avatar  avatar

Forkers

isgasho

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.