this post was submitted on 18 Apr 2026
48 points (92.9% liked)
Programming
26563 readers
251 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I first built a dice roller : the core is just a call to random.randint module, but you need to have the terminal interface to get the instruction ( like "4d6" means you need to have 4 times random generation between 1 and 6). You can do it only with regexp, and if you want to get fancy you can try and find solutions to have compounded formulas, try to have the results stored during a game session, etc.
Second project was a small game: the idea was to have a map of coordinates (xy), and each game has random spawning of 2 goblins and 3 gold within the map ; the goal is to move around (nswe) getting the 3 gold without hitting a goblin.
So also no graphic representation of the map, you just have the game running at each keystroke.
You just need to be able to define functions and do string manipulation ; for logic you can stay with if-then-else and while loop.
And good luck with the learning !