Skip to content

Instantly share code, notes, and snippets.

@JamesJinPark
JamesJinPark / Odd_Even Game
Last active August 29, 2015 14:05
Assignment 1
"""I am the creator of this program.
This is a gambling game where one player is "Even" and the other player is "Odd."
Each player begins with some money, and each player chooses some money to bet.
If the sum is odd, the odd player wins.
If the sum is even, the even player wins.
Play ends when a player has less than twice the maximum bet.
Play also ends when the human player decides to quit by entering a bet of 0.
"""
import random
@JamesJinPark
JamesJinPark / gist:4a75a9d6b73c22fab474
Created August 29, 2014 20:29
Assignment 1 - Odd / Even game
#I am the creator of this program. This program is designed to implement a simple gambling game where one player is "odd" and the other player is "even." Each player begins witha certain amount of money and each player chooses some money to bet. If sum is odd, odd player wins. If sum is even, even player wins. Play continues until one or the other player has less than 2 * the maximum bet or until the human player decides to quit.
import random
a = "Human money"
b = "Computer money"
c = "Maximum bet"
Name = raw_input("Do you want to be even?")
@JamesJinPark
JamesJinPark / Assignment 2.py
Last active August 29, 2015 14:06
Figurate_Number
#Monica Ionescu and James Park
#Figurate Numbers
#This program tests for characteristics of positive integers (tests for figurate numbers)
import math
#This function compiles all other functions in this program, establishes a range of numbers, \
#and tests the numbers for each specific characteristic.
def main():
limit = 100
@JamesJinPark
JamesJinPark / Assignment 3(1).py
Last active August 29, 2015 14:06
Three_Musketeers
# The Three Musketeers Game
# by James Park and Joo Kim.
# In all methods,
# A 'location' is a two-tuple of integers, each in the range 0 to 4.
# The first integer is the row number, the second is the column number.
# A 'direction' is one of the strings "up", "down", "left", or "right".
# A 'board' is a list of 5 lists, each containing 5 strings: "M", "R", or "-".
# "M" = Musketeer, "R" = Cardinal Richleau's man, "-" = empty.
# Each list of 5 strings is a "row"
@JamesJinPark
JamesJinPark / Assignment 3(2).py
Last active August 29, 2015 14:06
Three_Musketeers_Test
import unittest
from three_musketeers import *
left = 'left'
right = 'right'
up = 'up'
down = 'down'
M = 'M'
R = 'R'
_ = '-'
#CIT 591
#Assignment 4 - HTML Tidy
#by James Park and Yue Chen
import Tkinter
import tkFileDialog
import os.path
import shutil
import random
import sys
@JamesJinPark
JamesJinPark / Assignment 4(2).py
Last active August 29, 2015 14:06
tidyHTML.test
#Test file for Assignment 4 - tidyHTML
#by James Park and Yue Chen
import unittest
from tidyHTML import *
import os
import re
class TestTidyHTML(unittest.TestCase):
global bad_content, bad_content1, bad_content2, bad_content3, bad_content4, too_long_line
# Classes and methods for a simple library program
# Authors: Dave Matuszek and James Park and Josh Kessler
#--------------------------------------------------------------
class Calendar(object):
"""Keeps track of the durrent date (as an integer)."""
def __init__(self):
"""Creates the initial calendar."""
self.date = 0
@JamesJinPark
JamesJinPark / Assignment 5(2)
Last active August 29, 2015 14:07
library_test.py
import unittest
from library import *
lib = Library()
lib.open()
class CalendarTest(unittest.TestCase):
def test_calendar(self):
cal = Calendar()
@JamesJinPark
JamesJinPark / Negadecimal.java
Created November 3, 2014 21:55
Assignment 9(1)
package negadecimalCalculator;
import java.util.Scanner;
public class NegadecimalCalculator {
public static void main(String[] args) {
// TODO Auto-generated method stub
new NegadecimalCalculator().REPL();
}
public String evaluate(String s){
}