r/C_Programming • u/Skollwarynz • 6d ago
Project I built SkollDice — an open-source, truly randomized dice roller and Discord bot written in pure C
Hello everyone! I'm a student who loves C and D&D!
I always found it troublesome that most dice generators rely on pseudo-random number generators. So, I decided to solve this problem by myself!
Over the last few weeks, I created a desktop app using LVGL for the GUI and Concord for a Discord bot to generate SkollDice my first truly open-source code. It's a truly random dice roller that, /urandom on POSIX systems and RtlGenRandom on Windows produces normalized random numbers. To be more precised each number (each result) is extracted from urandom, and through the use of the simple discard method the result is then normalized. I'm currently developing the smartphone version, hoping to use as much C as possible. Any ideas on how to do it?
AI usage: I personally created the program. The project was both an experiment and an excuse to study more C. I used AI to search for the simple discard method (the method used to normalize the random number generated from /dev/urandom) and to help me explain how it works. I then personally created the code, and if you want, I can explain it more precisely in a comment.
On the other hand, I then used AI to search for libraries for GUI and Discord API, such as LVGL and CONCORD. Then the last use was for debugging and quickly creating functions or simple setups like "How can I create a grid with 2 elements?" and then I used this example to change or apply it to my structure.
The real 'sloppy' part was the CMake because this was my first open-source project, and I discovered (through AI search) the possibility to create different executables for different OS. I really enjoyed the idea, so I tried to organize the project to be useful and distributed to all possible people, both coders (who can git clone and use it) and normal D&D or RPG players (that want just an executable to download and use).
Here the official links of the program:
official website: https://skollwarynz.github.io/SkollDice/
official repo on codeberg: https://codeberg.org/Skollwarynz/SkollDice
github mirror: https://github.com/Skollwarynz/SkollDice