31 lines
816 B
Python
31 lines
816 B
Python
#!/bin/python3
|
|
import sys,time,re
|
|
from pprint import pprint
|
|
sys.path.insert(0, '../../')
|
|
from fred import list2int,get_re,nprint,lprint,loadFile,toGrid,TSP,dijkstra
|
|
start_time = time.time()
|
|
|
|
input_f = 'test'
|
|
|
|
part = 1
|
|
#########################################
|
|
# #
|
|
# Part 1 #
|
|
# #
|
|
#########################################
|
|
|
|
if part == 1:
|
|
grid = toGrid(input_f,True)
|
|
nprint(grid)
|
|
|
|
print(dijkstra(grid,0,9))
|
|
|
|
#########################################
|
|
# #
|
|
# Part 2 #
|
|
# #
|
|
#########################################
|
|
if part == 2:
|
|
exit()
|
|
|
|
print("--- %s seconds ---" % (time.time() - start_time)) |