def test_findWalls(self): # arrange wf = WaterFountain() wf.load(test1) # act result = wf.findWalls(499,10) # assert self.assertEqual(result.a, [498,504])
def test_findEdge(self): # arrange wf = WaterFountain() wf.load(test1) # act result = wf.findEdge(500,2) # assert self.assertEqual(result.a, [499,502])
def test_load_data_wf(self): # arrange wf = WaterFountain() # act wf.load(test1) result = wf.getGridItem(495,7) # assert self.assertEqual(result, '#')
def test_grid_print(self): # arrange wf = WaterFountain() # act wf.load(test1) # assert wf.printGrid() self.assertTrue(True)
def test_tryDown(self): # arrange wf = WaterFountain() # act wf.load(test1) wf.tryDown(500,0) # assert wf.printGrid() self.assertTrue(True)
def test_do_fill_with_water(self): # arrange wf = WaterFountain() # act wf.load(test1) wf.doFillWithWater() # assert wf.printGrid() self.assertTrue(True)
# Advent of Code 2018: https://adventofcode.com/2018/day/17 # # Main file import datetime, time from datetime import timedelta from AoC17_classes import WaterFountain start = datetime.datetime.now() inputData = open('../../data/input17.txt', 'r') liveData = inputData.readlines() wf = WaterFountain() wf.load(liveData) wf.printGrid() # scores = bb.getScores() # print('\nPart 1: The outcome of the combat is', inputData, 'is', scores) # print('\nPart 2: The location of the last cart is', cart.print()) end = datetime.datetime.now() duration = end - start print('Completed in {0:02d}:{1:02d}:{2:02.5f}\n'.format( int(duration.seconds / 3600), int(duration.seconds / 60), duration.seconds % 60 + duration.microseconds / 1000000))