Code, Python

NES catalog database

Download the code at https://github.com/brettius/nes-database A Python database capable of cataloging old cartridge games in a collection, this one specifically for Nintendo Entertainment System cartridges. The following is the procedural code. The code starts by importing the needed modules. The regular expression module is to be used to attempt to ensure clean data entry. import database import pickle import re Define…

Continue Reading
Code, Python

Historical weather in Austin, TX

First try at running data analysis using Python to access an Excel workbook, extract the relevant information, and display it in a graph using pyplot. First is to import the scv module, pyplot, read through the excel sheet and enter the high temperature and the current date into lists. import csv from matplotlib import pyplot as pt from datetime import…

Continue Reading
Code, Python

Checksum Checker

Download at https://github.com/brettius/checksum-checker Simple checksum checker to compare two different checksums, or any strings. print(‘Checksum Checker v1.0\n’) check_one = input(‘Enter first checksum:\n\n’) check_two = input(‘\nEnter second checksum:\n\n’) if check_one.strip() == check_two.strip():    print(‘\nSuccess! Matching checksums’) else:    print(‘\nDid not match. Re-download the file.’)  input(‘\nPress a key to exit’)

Continue Reading
Code, Python

D&D Battle Tracker

Download code at https://github.com/brettius/d-d-battle-tracker A text program that keeps track of important statistics for the Dungeons and Dragons role playing game. First the code import pickle, define the main function, comprising a dictionary and the user menu. import pickle print(‘Barbarian Battle Tracker’) def main():                             player_stats = {‘HP’: 0, ‘Max HP’ : 0 ,’Hit Dice’: 0,…

Continue Reading
Code, Python

Farmer River Crossing Puzzle

Download full code at at https://github.com/brettius/farmer-river-crossing-game 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 who will eat the corn. The highest level function is defined…

Continue Reading
Code, Python

D&D Multi Dice Roller

Download full code at https://github.com/brettius/d-and-d-dice-roller A multiple dice roller program, suitable for Dungeons and Dragons role playing game. The user can select a number of dice and amount, then roll the selected dice. First, a function is built to get the name of the dice, for example, a ‘d4’, and how many are chosen, and insert the name, the lowest and…

Continue Reading