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, our popular Indian board game, completely implemented in C++
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
- 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 )
mkdir build -p && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
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 π
.
βββ 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
-
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()
-
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 thensrc
to know how a particular function works. -
//!
or/**/
-> This syntax for comments has been used for giving info of the code. -
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
andplayerMap
- 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!
- To change Order of Gameplay, you only need to change one vector, ie.
-
Many more if when you search (yaar please consider point 1, if that's the case :-)
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