Skip to content

Instantly share code, notes, and snippets.

@zeimusu
zeimusu / mentalist.py
Last active August 29, 2015 14:15
A little guessing game, "Mentalist poker" http://www.benefactum.ca/?p=274
#!/usr/bin/env python3
import random
import os
import sys
"""
Mentalist Poker http://www.benefactum.ca/?p=274
1. Each player starts with 20 chips or counters of some sort, a screen to hide
them, and a “betting line,” perhaps a piece of string or a pencil, placed
horizontally in front of him (but behind the screen). Chips placed in front of
@andrewxhill
andrewxhill / rivers.md
Last active April 28, 2017 17:29
Steps used to make map of California rivers
@zeimusu
zeimusu / moonlander.py
Created November 1, 2014 10:24
Usbourne Computer Space Games was a type-in computer games book from the 1980s. This is a version of "Moonlander" game. Original BASIC by Daniel Isaaman and Jenny Tyler
#!/usr/bin/env python3
# Usbourne Computer Space Games was a type-in computer games book
# from the 1980s. This is a version of "Moonlander" game.
# Original BASIC by Daniel Isaaman and Jenny Tyler
from time import sleep
print(chr(27) + "[2J") # Clear screen
print("Moonlander")
#Set the starting values
@zeimusu
zeimusu / traitor.py
Created November 1, 2014 10:17
Usbourne Computer Battlegames was a type-in computer games book from the 1980s. This is a version of "Battle at Traitors Castle" game. Original BASIC by Daniel Isaaman and Jenny Tyler
#!/usr/bin/env python3
#Usbourne Computer Battlegames was a type-in computer games book
#from the 1980s.
#This is a version of "Battle at Traitors Castle" game.
#Original BASIC by Daniel Isaaman and Jenny Tyler
import curses
@zeimusu
zeimusu / gravity.py
Last active August 29, 2015 13:56
A gravity simulator. There are several choices for the integration method. I've found verlet to be most stable
#!/usr/bin/env python3
import tkinter as tk
import numpy as np
from numpy import sin, cos, sqrt
G = 6.67384e-11 # m^3 kg-1 s-2
DEG = np.pi / 180
AU = 1.49597871e11 # for converting to meters
METRE = 1 / 1.49597871e11 # for converting to AU