コード例 #1
0
ファイル: test.py プロジェクト: jmhobbs/advent-of-code-2015
def test_on_some():
    lg = LightGrid(6, 6)
    lg.turn_on(2, 2, 3, 3)
    assert lg.lights_on() == 4
コード例 #2
0
ファイル: 1.py プロジェクト: jmhobbs/advent-of-code-2015
from grid import LightGrid

lg = LightGrid()

with open("input.txt", "rb") as handle:
    for line in handle:
        lg.parse_instruction(line)

print "Lights on: %d" % lg.lights_on()
コード例 #3
0
ファイル: test.py プロジェクト: jmhobbs/advent-of-code-2015
def test_on():
    lg = LightGrid(3, 3)
    lg.turn_on(0, 0, 2, 2)
    assert lg.lights_on() == 9