Skip to content

Instantly share code, notes, and snippets.

@74togo
74togo / Recipes
Last active December 14, 2015 21:08
=====================
Frozen Chicken:
=====================
1 Preheat oven to 375.
2 Spray baking dish with non-stick spray.
3 Place frozen chicken breast in dish.
4 Top with sauce.
5 Bake for 45 minutes.
6 Options: Add veggies for a one dish meal.
@74togo
74togo / artillery.java
Created January 26, 2013 19:31
Little artillery game
import java.util.*;
import java.lang.Math.*;
import java.text.*;
public class artillery {
private static Random rand = new Random(); // We use this to generate random numbers
public static String input(String s) {
/* input() simplifies the process of asking for input
@74togo
74togo / combsort.java
Created January 26, 2013 19:30
Comb Sort Example
import java.util.*;
public class CombSort {
public static void sort(int[] array, int size) {
/*
This function sorts a list in-place using CombSort11.
It works exactly like BubbleSort except that instead of
looking at i and i+1 when iterating, it looks at i and i+gap.
This helps reposition small values stuck at the end of the array.
@74togo
74togo / Elo.py
Created September 13, 2012 18:49
A demonstration of the Elo rating system for 2-player competitions.
class Player:
""" The "player" to be ranked """
def __init__(self):
""" Base rating of 1600 always """
self.rating = 1600
def getWinProb(self, opponent):
""" Probablility that self will win against opponent """
@74togo
74togo / basketball.py
Created August 8, 2012 15:14
It beats the basketball Google doodle
import time
import win32api, win32con
t=0.5
def play():
time.sleep(1)
s = time.time()
throws=0
while throws < 10: