示例#1
0
def test_on_some():
    lg = LightGrid(6, 6)
    lg.turn_on(2, 2, 3, 3)
    assert lg.lights_on() == 4
示例#2
0
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
def test_on():
    lg = LightGrid(3, 3)
    lg.turn_on(0, 0, 2, 2)
    assert lg.lights_on() == 9