Skip to content

Instantly share code, notes, and snippets.

View lukasrichters14's full-sized avatar

lukasrichters14

View GitHub Profile
@lukasrichters14
lukasrichters14 / Nim.py
Created September 27, 2018 00:49
A simplified version of the game of Nim in which a player plays against a computer player.
###############################################################################
#
#Computer Project #2
#
#Algorithm
#
# Get if user wants to play the game
# Initialize starting state variables for a new game
# Display current amount of stones in each pile (5)
# Until the game is won, player and computer alternate turns taking stones
@lukasrichters14
lukasrichters14 / Caesar-Affine Encryption and Decryption.py
Created September 27, 2018 00:43
An encryption/decryption program that uses the Caesar and Affine encryption methods to encrypt a string of text.
###########################################################
# Computer Project #3
#
# Algorithm
# Prompt to encrypt, decrypt, or quit
# Initialize variables that need to be appended to or used in the program
# Generate string of all lowercase alphabetic characters
# Ask for keyword of only alphabetic charactes and less than 26 characters
# Ask for a message to encrypt/decrypt
# If Encrypt:
@lukasrichters14
lukasrichters14 / Atomic Mass Calculator.py
Created September 27, 2018 00:31
An atomic mass calculator made with python.
# Dictionary of all elements matched with their atomic masses.
elements_dict = {'H' : 1.008,'HE' : 4.003, 'LI' : 6.941, 'BE' : 9.012,\
'B' : 10.811, 'C' : 12.011, 'N' : 14.007, 'O' : 15.999,\
'F' : 18.998, 'NE' : 20.180, 'NA' : 22.990, 'MG' : 24.305,\
'AL' : 26.982, 'SI' : 28.086, 'P' : 30.974, 'S' : 32.066,\
'CL' : 35.453, 'AR' : 39.948, 'K' : 39.098, 'CA' : 40.078,\
'SC' : 44.956, 'TI' : 47.867, 'V' : 50.942, 'CR' : 51.996,\
'MN' : 54.938, 'FE' : 55.845, 'CO' : 58.933, 'NI' : 58.693,\
'CU' : 63.546, 'ZN' : 65.38, 'GA' : 69.723, 'GE' : 72.631,\
'AS' : 74.922, 'SE' : 78.971, 'BR' : 79.904, 'KR' : 84.798,\