MCPcopy Create free account
hub / github.com/AxlLind/AdventOfCode / main

Function main

2018/src/15.py:72–80  ·  view source on GitHub ↗
(indata: str)

Source from the content-addressed store, hash-verified

70
71@aoc.main('15')
72def main(indata: str) -> tuple[int,int]:
73 m = [[(c,200) for c in s] for s in indata.split('\n')]
74 dmg = {'E': 3, 'G': 3}
75 winner, p1 = simulate(dmg,m)
76 initelves = count_left(m)[0]
77 while winner != 'E':
78 dmg['G'] += 1
79 winner, p2 = simulate(dmg,m,initelves)
80 return p1,p2
81
82if __name__ == "__main__":
83 main()

Callers 1

15.pyFile · 0.70

Calls 2

count_leftFunction · 0.85
simulateFunction · 0.70

Tested by

no test coverage detected