Skip to content

Instantly share code, notes, and snippets.

@megafauna
megafauna / simulate.lua
Created August 30, 2014 21:32
Simulate poker chicken hands in lua
local _ = require("moses")
local stats = require("stats")
local seed = 1
local HLEN = 5
local NUM_CARDS_IN_DECK = 52
local TOTAL_HANDS = NUM_CARDS_IN_DECK - HLEN + 1
local ranks = {nil, "2","3","4","5","6","7","8","9","T","J","Q","K","A"}
-- alt_rankmap is only for testing Ace-low straights
@megafauna
megafauna / simulate.py
Created August 28, 2014 20:06
Simulate poker chicken hands
from __future__ import print_function
from random import shuffle, seed
from itertools import product
from collections import Counter
#seed(100)
ranks = list('23456789TJQKA')
alt_ranks = list('A23456789TJQK')
suits = list('CSHD')
new_deck = list(product(ranks, suits))
@megafauna
megafauna / main.py
Created August 17, 2014 00:25
Math Artist App Engine code
#!/usr/bin/env python
from __future__ import print_function
import webapp2
import os, os.path
import json
import logging
import time
import random
from google.appengine.ext.webapp import template, util