Dice Rolling Program in Python


A friend had an assignment in his intro-CS classes to write a program that could roll X number of die and print an asterisk for each time the die lands on a certain result. I decided to try my hand at this in Python since I am still learning how to best use the language. However, I decided to spruce it up a bit with a legend to allow higher amounts of dice counts to be displayed more neatly, and to total the throws. The code can be found here. Writing code in Python feels so much lighter and agile than writing code like this in Java. I wrote a simpler implementation in Java that only met the requirements of this project just to compare the two syntactically (bearing in mind the usage of Unicurses library calls in the python implementation.) The code for that is here. For someone who started out learning language like C/Java/.NET python is a breath of fresh air.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s