Code, Python

D&D Battle Tracker

A text program that keeps track of important statistics for the Dungeons and Dragons role playing game. import pickle print(‘Barbarian Battle Tracker’) def main(): player_stats = {‘HP’: 0, ‘Max HP’ : 0 ,’Hit Dice’: 0, ‘Exp’: 0, ‘Rages’:0} run = True while run == True: player_stats_print_dictionary(player_stats) menu = main_menu() if menu == 1: player_stats[‘HP’] = damage(player_stats[‘HP’]) elif menu == 2:…

Continue Reading
Code, Python

The farmer crossing the river puzzle

One of the classic puzzles. How does a farmer get a fox. a goose corn across a river? Constraints are that only one item can be taken at a time, and certain items cannot be left with each other, for example the goose will eat corn.   print(‘The Farmers River Crossing v1.0\n’) def main(): print_game_introduction() play_again = True while play_again…

Continue Reading
Code, Python

D&D Multi Dice Roller

Multiple dice roller program. The user can select a number of dice and amount, then roll the selected dice. import random print(‘D&D Dice Roller v1.0\n’) #Fucntion for getting dice name and number def choose_dice(name, amount): lowest = int(input(‘How many?’)) highest = lowest * amount dice_list = [] dice_list.append(name) dice_list.append(lowest) dice_list.append(highest) return dice_list #Start the dice selection loop select_dice = True…

Continue Reading
Code, Python

Checksum Checker GUI

I needed to compare checksums from different Linux distros. Comparing them by placing the them next to each other in notepad took too long and was potentially too error prone. This program compares two checksums (or any two strings that are long) to each other and returns a message if it was a successful match or not. import tkinter as…

Continue Reading