Giter VIP home page Giter VIP logo

ludo-the_game's Introduction

CMake Codacy Badge deepcode CodeFactor Build Status

The repo now has a web version too, added by @Athi223, and is available in web/ directory, and deployed at https://ludo-the-game-a10a0.web.app/ πŸŽ‰

Ludo - The Game v2.0

Ludo, our popular Indian board game, completely implemented in C++

β€œScreenShot”

Do put your suggestions, ideas, and any problem (even if why g++ main.cpp doesn't work). I will be thankful to you for trying it out :D

Features

  • Easy and Powerful customisability (More in developer notes)
  • Variable number of inputs at all input fields
  • Shortcuts, Keywords, Cheat codes
  • Two robot modes -
    • RandomRobo
    • ThinkerRobo (it will chose the best possible move at a time, from almost 30-90 possibilities)
  • Display adaptive to width of screen
  • Memory-safe (using smart_pointers, and uncounted for 'new' statements)
  • Multi-threaded (for ThinkerRobo execution)
  • 0 dependencies outside stdc++ (for coloured output support, agauniyal.github.io/rang/ is utilised and included as a header rang.hpp)
  • Plus all basic ludo game features, and my own custom keywords (you can create yours too :D )

Building

On Linux -

mkdir build -p && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .

For Windows -

mkdir build -p
cd build
cmake ..
cmake --build . --config Release

After building you will have a ludo.exe inside build/Release or build/Debug etc, as per your build type, that's your executable πŸ˜ƒ

Files in the Project

.
β”œβ”€β”€ extras
β”œβ”€β”€ util    //my utility library
β”œβ”€β”€ includes
β”‚   β”œβ”€β”€ boardPrinter.hpp
β”‚   β”œβ”€β”€ rang.hpp
β”‚   β”œβ”€β”€ die.hpp
β”‚   β”œβ”€β”€ enumerations.hpp
|   β”œβ”€β”€ exceptions.hpp
|   β”œβ”€β”€ game.hpp
|   β”œβ”€β”€ keywords.hpp
|   β”œβ”€β”€ ludo_box.hpp
|   β”œβ”€β”€ ludo_coords.hpp
|   β”œβ”€β”€ ludo_goti.hpp
|   β”œβ”€β”€ ludo_state.hpp
β”‚   └── thinker.hpp
β”œβ”€β”€ src
|   β”œβ”€β”€ game.cpp
|   β”œβ”€β”€ ludo_box.cpp
|   β”œβ”€β”€ ludo_coords.cpp
|   β”œβ”€β”€ ludo_goti.cpp
|   β”œβ”€β”€ ludo_state.cpp
|   β”œβ”€β”€ thinker.cpp
β”œβ”€β”€ main.cpp
β”œβ”€β”€ CMakeLists.txt
β”œβ”€β”€ LICENSE.md
└── README.md

DEVELOPER NOTE -

  1. Even though, the codebase may seem big, or confusing, to understand how, you should see the "name of the functions" that gets called inside these, in this order -

    • main.cpp
    • board.cpp::Init_Game()
    • board.cpp::play()
  2. I think only seeing the names of functions calls in these, you would get the workflow of this(the functions have been named such)... then if you want to dive more, see the includes directory first, and then src to know how a particular function works.

  3. //! or /**/ -> This syntax for comments has been used for giving info of the code.

  4. The whole structure of the code is such that most things can be easily changed, to be able to show effect elsewehere too, some of which for eg.

    • To change Order of Gameplay, you only need to change one vector, ie. colourOrder<>
    • Different Players can be bound to different gotis, as you want, just update the colourMap and playerMap
    • To change Number of Gotis, just update the goti_per_user, and internally it just got implemented! No fuss
      • And, for display on output : In the updateDisplay(), may use if conditions to add an additional type2() row, for each +2 gotis of goti_per_user
    • In most apps, even if you get a 6, you have to decide your move then, but at our gaon, we could proceed to roll the die, till its not 6, YOU can opt any of those ways, for that, replace dieNumbers<> to a single integer!
  5. Many more if when you search (yaar please consider point 1, if that's the case :-)

Contribution -

Start an issue for whatever feature you believe should be good here.

And, in case you want to be a contributer here, and work on it together, do ask.

Do sugggest any other feature you would like, i do claim the codebase to be quite modular, and easily customisable (It was what i used to think earlier, it IS modular enough to understand, i am not modifying it now, so as to keep it more original when i made it).

Thanks ! :D

ludo-the_game's People

Contributors

adi-g15 avatar athi223 avatar silentwatcher3 avatar abraham-john-paul avatar dependabot[bot] avatar imgbotapp avatar melakki avatar codacy-badger avatar code-factor 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.