Go here to see the python script!
51480
{0: 1, 1: 65, 2: 1253, 3: 9653, 4: 27422, 5: 12946, 6: 140}
0494fc7e6e72b2cc80f06bb5a1afec91c72b82bcff527e66c021e90d4fc1be41342d9a8f22ba4973402131f90a08c723f221729ef56b09f25f2be9d475b1b3ae34;matty1983 |
import random | |
def enum(**enums): | |
return type('Enum', (), enums) | |
Coin = enum(HEADS='H', TAILS='T') | |
Team = enum(RED='Red', BLUE='Blue') | |
Goal = enum(RED=[Coin.HEADS, Coin.TAILS], BLUE=[Coin.HEADS, Coin.HEADS]) | |
def flip(): |
import random | |
def open_pack(set_size=100): | |
return random.sample(xrange(set_size), 10) | |
def collect(set_size=100): | |
owned = set([]) | |
packs_bought = 0 | |
while len(owned) != set_size: | |
packs_bought += 1 |
#!/usr/local/bin/python | |
# -*- coding: utf-8 -*- | |
# See: https://gist.github.com/jmhummel/fe7604ab830567d5939b21d3e6c57dfa for results! | |
import ast | |
import random | |
import datetime | |
import multiprocessing | |
from multiprocessing import Pool |
Go here to see the python script!
51480
{0: 1, 1: 65, 2: 1253, 3: 9653, 4: 27422, 5: 12946, 6: 140}
MIT License | |
Copyright (c) 2018 Jeremy Hummel | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
from timeit import Timer | |
a = [984, 981, 976, 950, 899, 890, 887, 885, 880, 800, 798, 790, 777, 767, 750, 701, 697, 688, 680, 678, 650, 599, 589, | |
567, 550, 501, 9, 8, 7, 6, 5, 4, 3, 2, 1] | |
b = [1090, 1080, 1074, 1065, 1057, 1056, 1047, 1041, 1041, 1038, 1025, 1013, 1008, 992, 991, 991, 991, 978, 977, 959, | |
945, 935, 925, 925, 923, 915, 908, 904, 901, 901, 900, 897, 894, 882, 880, 876, 866, 854, 849, 849, 833, 818, 818, | |
812, 811, 809, 798, 794, 793, 788, 772, 763, 747, 746, 743, 737, 736, 734, 732, 730, 728, 718, 714, 713, 706, 701, | |
699, 691, 690, 689, 681, 672, 663, 656, 654, 653, 652, 651, 646, 644, 640, 637, 637, 635, 634, 633, 630, 625, 621] | |
from heapq import heappush, heappop | |
import numpy as np | |
from collections import deque | |
STATES = [(0, 0, 0, 0), (0, 0, 0, 1), (0, 0, 1, 1), (0, 1, 0, 1), (0, 1, 1, 1), (1, 1, 1, 1)] | |
ACTIONS = STATES[1:] | |
STATE_MAP = {state: i for i, state in enumerate(STATES)} | |
ACTION_MAP = {action: i for i, action in enumerate(ACTIONS)} |