fixed some file bugs

This commit is contained in:
Tristan 2019-01-02 01:12:02 +00:00
parent 700cfbde66
commit 7bab2084eb
5 changed files with 15 additions and 5 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
build
frames
.DS_Store
.vscode

View file

@ -1,4 +1,7 @@
with open('input.txt', 'r') as input:
import os
path = os.path.dirname(os.path.abspath(__file__))
with open(path+'/input.txt', 'r') as input:
counter = 0
text = input.readline()
for char in text :

View file

@ -1,4 +1,7 @@
with open('input.txt', 'r') as input:
import os
path = os.path.dirname(os.path.abspath(__file__))
with open(path+'/input.txt', 'r') as input:
pos = 0
char_pos = 0
text = input.readline()

View file

@ -1,4 +1,7 @@
with open("input.txt", "r") as commands:
import os
path = os.path.dirname(os.path.abspath(__file__))
with open(path+"/input.txt", "r") as commands:
x = 0
y = 0
history = []

View file

@ -1,6 +1,6 @@
const fs = require('fs');
let input = fs.readFileSync('input.txt', 'utf-8').split('\n').sort((a, b) => val(a).getTime() - val(b).getTime());
let input = fs.readFileSync(`${__dirname}/input.txt`, 'utf-8').split('\n').sort((a, b) => val(a).getTime() - val(b).getTime());
function val(a) {
let time = new Date(a.match(/\[(.*)\]/)[1]);