This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Federation NOMA', () => { | |
it('has ambition', () => { | |
expect(federation.creativeWorkspace).toBe('great'); | |
expect(federation.buildings.length).toBeGreaterThan(1); | |
expect(federation.people.filter((person) => person.cares)).toBeNonEmpty(); | |
expect(federation.wifiSpeedMbps).toEqual(1024); | |
}); | |
it('can have my people too', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import count | |
def calc(target_x, target_y): | |
for i in count(): | |
for x in range(1, i): | |
y = i - x | |
if (x,y) == (1,1): | |
code = 20151125 | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from operator import mul | |
INPUT = """1 | |
2 | |
3 | |
5 | |
7 | |
13 | |
17 | |
19 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
from itertools import count | |
from random import sample | |
PLAYER_HP = 50 | |
PLAYER_MANA = 500 | |
BOSS_HP = 71 | |
BOSS_DAMAGE = 10 | |
Spell = namedtuple('Spell', ['name', 'cost']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
registers = {'a': 1, 'b': 0} | |
def hlf(r): | |
registers[r] /= 2 | |
return 1 | |
def tpl(r): | |
registers[r] *= 3 | |
return 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
from itertools import chain, combinations, product, ifilterfalse | |
Item = namedtuple('Item', ['cost', 'damage', 'armour']) | |
BOSS_HIT_POINTS = 100 | |
BOSS_DAMAGE = 8 | |
BOSS_ARMOUR = 2 | |
INPUT_WEAPONS = """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
from itertools import chain, count | |
from math import sqrt | |
TARGET = 36000000 | |
factors = lambda i: set(chain.from_iterable((x, i // x) for x in filter(lambda x: i % x == 0, range(1, int(sqrt(i)) + 1)))) | |
part_one = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import partial | |
from itertools import count | |
import re | |
INPUT = """Al => ThF | |
Al => ThRnFAr | |
B => BCa | |
B => TiB | |
B => TiRnFAr | |
Ca => CaCa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from itertools import product | |
GRID_SIZE = 100 | |
INPUT = """#...##......#......##.##..#...##......##.#.#.###.#.#..#..#......####..#......###.#.#....#..##..###.. | |
####..#.#...#....#.#####.##.##.#..#.......#....#.##...###.###..#.#.#........#..#.#.##...##..#.####.# | |
...#..##...#.#.###.#.###..#.##.####.###...#...........#.###..##.#.##.#.###...#.#..###....#.###.#..#. | |
.#...##...####.#..#.....#..#...#.#.##...#...##..#.#.###....#..###.....##..#.###..###.....##..###...# | |
..##.#####....##..#.#..##.##..######...#..###.######.....#..##...#.#..##..##..#..#..#..##.#.#.#.#... | |
.###.###.###...##...##..###..##.###.#.....##..##.#.#########...##..##.#..##.#..##..####..#.#.#.##### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INPUT = """50 | |
44 | |
11 | |
49 | |
42 | |
46 | |
18 | |
32 | |
26 | |
40 |