This week I wanted to do something different and share a fun little side project I put together! A bit of backstory: I've recently begun playing Dungeons and Dragons with some friends and think it's awesome, and going through the trouble of learning how to determine my character's HP at each level was some combination of humorous and frustrating. When I figured out the math, I decided to really solidify the concept and save future me some time in the process... and so the D&D Max Hit Points Calculator was born!
I built the Calculator as a Windows Form Application and it is quite simple and easy to use (and would be a fun learning project for anyone getting into C#). Simply enter your character's current max HP (or 0 if it's a new level 1 character) into "Current Max HP", put your Constitution modifier value into "Const Modifier", and click Roll after selecting the hit die your class was designated to generate your rolled die value. Click Calculate Max Hit Points and voila - the math's been done for you! The "Current Max HP" value will even update, making rolling for multiple levels a snap.
Here's a link to the source code: D&D Max Hit Points Calculator. You are welcome to use this project for whatever you'd like (except selling or distributing it, obviously). Feel free to learn with it, copy and tweak it, use it for your own D&D games, or even comment/email me with suggestions (r_soderberg@yahoo.com).
If you'd like to catch up with me on social media, come find me over on Twitter or LinkedIn and say hello!
Top comments (3)
I took a look at your code. It's a nice little utility.
A couple of things just to let you know. I tried to build the code but the repo is missing a few items:
I built it and got it going by
Also, normally you don't check in the binaries (stuff under \bin) to source control. But maybe you did that so people could try the program out easily.
Just some tips to help out.
Have a great day and...
Keep on learning, keep on coding
Hey, thanks for the info and tips! This was my first time posting a project as "open source" so I'm not surprised there were a couple hiccups. I'll go ahead and fix that up later today.
Glad to help. Also, if you add a .gitignore file to your project root folder you will find that the extra things like /obj/ and /bin directories and associated files are not added -- it'll only track your source files which is what you want.
Github provides a nice Visual Studio / C# .gitignore for you at:
github.com/github/gitignore/blob/m...
All you have to do is :
After that, your local git will ignore those files. Since you've already added them you may have to work a bit to remove them from your git repo, but it'll still help. :)