Skip to content

Instantly share code, notes, and snippets.

@NeKzor
Created January 9, 2020 08:46
Show Gist options
  • Save NeKzor/032b9f6d006fec6943c8c246aa364f59 to your computer and use it in GitHub Desktop.
Save NeKzor/032b9f6d006fec6943c8c246aa364f59 to your computer and use it in GitHub Desktop.
Next level routing feat. The Beginners Guide.
const fs = require('fs');
const validCommands = ['color', 'wait', 'play', 'fire', 'clear', 'reset', 'say2'];
const parseVoice = (voice, line) => {
let curCommand = undefined;
let commands = [];
for (let c of line) {
if (c === '[') {
curCommand = '';
} else if (c === ']') {
commands.push(curCommand);
curCommand = undefined;
} else if (curCommand !== undefined) {
curCommand += c;
}
}
if (curCommand !== undefined) {
throw new Error('Command not closed!');
}
commands = commands.map((command) => {
let cmd = validCommands.find((cmd) => command.toLowerCase().startsWith(cmd));
if (!cmd) throw new Error('Invalid command type: ' + command);
return { [cmd]: command.split(' ')[1] || null };
});
if (/Opt[0-9]\: /g.test(line)) {
voice.options.push({ commands });
} else {
voice.commands.push(...commands);
}
};
const parseTree = (buffer) => {
let tree = {
isModern: false,
voices: [],
start: undefined,
};
let voiceName = undefined;
let curVoice = undefined;
let lineCount = 0;
for (let line of buffer.split('\n')) {
++lineCount;
line = line.trim();
if (line.length === 0) {
continue;
}
if (line.startsWith('#modern')) {
tree.isModern = true;
} else if (!voiceName && !curVoice && /^[a-zA-Z0-9]+$/g.test(line)) {
voiceName = line;
} else if (line.startsWith('{')) {
curVoice = { options: [], commands: [] };
} else if (line.startsWith('}')) {
curVoice.name = voiceName;
tree.voices.push(curVoice);
voiceName = undefined;
curVoice = undefined;
} else if (curVoice !== undefined) {
parseVoice(curVoice, line);
} else if (line.startsWith('[')) {
tree.start = line.slice(1, line.length - 1);
} else {
throw new Error('Invalid token at line: ' + lineCount);
}
}
return tree;
};
const findFastestPath = (tree) => {
//console.dir(tree, { depth: 10 });
const trace = (voiceName, prevVisited = []) => {
/* entered a loop */
if (prevVisited.find(name => name === voiceName)) {
return [{ option: [], time: 999 }];
}
let voice = tree.voices.find((voice) => voice.name === voiceName);
let options = voice.options.length !== 0 ? voice.options : [{ commands: voice.commands }];
let node = [];
let visited = [...prevVisited, voiceName];
/* 0-2 = index options, -1 = no options */
let curOption = voice.options.length !== 0 ? 0 : -1;
/* just in case */
if (voice.options.length !== 0 && voice.commands.find(({ wait }) => wait)) {
throw new Error('cannot handle wait before or after options');
}
for (let { commands } of options) {
/* total amount of seconds to wait */
let time = commands
.map(({ wait }) => wait ? parseFloat(wait) : 0)
.reduce((acc, val) => acc + val, 0);
/* visit next voice */
let next = commands.find(({ play }) => play);
if (next) {
let result = trace(next.play, visited);
node.push(...result.map((r) => ({ option: [...r.option, curOption], time: r.time + time })));
} else {
node.push({ option: [], time });
}
++curOption;
}
return node;
};
return trace(tree.start);
};
const evaluateResult = (result) => {
if (result.length === 0) {
return console.log('no result');
}
const byTimeThenScore = (asc) => (a, b) => {
if (a.time === b.time) {
let s1 = a.option.reduce((acc, val) => acc + val, 0);
let s2 = b.option.reduce((acc, val) => acc + val, 0);
return asc ? s1 - s2 : s2 - s1;
}
return asc ? a.time - b.time : b.time - a.time;
};
const fastestAll = [...result].filter(x => x.time < 999).sort(byTimeThenScore(true));
const slowestAll = [...result].filter(x => x.time < 999).sort(byTimeThenScore(false));
if (fastestAll[0].time === slowestAll[0].time) {
return console.log('does not matter');
}
console.log('fastest:');
for (let result of fastestAll.filter((r) => r.time === fastestAll[0].time)) {
console.log(' time: ' + result.time);
console.log(' path: ', [...result.option].reverse());
}
console.log('slowest:');
for (let result of slowestAll.filter((r) => r.time === slowestAll[0].time)) {
console.log(' time: ' + result.time);
console.log(' path: ', [...result.option].reverse());
}
console.log('strategy:');
console.log(' timesave: ' + (slowestAll[0].time - fastestAll[0].time) + ' seconds');
console.log(' route: ', [...fastestAll[0].option].reverse().filter(x => x !== -1).map(x => 'Option ' + (x + 1)));
};
const main = () => {
const test = false;
const trees = 'C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Beginners Guide\\beginnersguide\\trees\\';
const readDir = (dir = '') => {
for (let file of fs.readdirSync(trees + dir)) {
if (file.endsWith('.txt')) {
console.log(`${dir}\\${file}`);
const tree = parseTree(fs.readFileSync(`${trees}${dir}\\${file}`, 'utf-8'));
const result = findFastestPath(tree);
evaluateResult(result);
console.log();
} else {
readDir(`${dir}\\${file}`);
}
}
};
if (!test) {
readDir();
} else {
const tree = parseTree(fs.readFileSync(`${trees}presence\\p2ta.txt`, 'utf-8'));
const result = findFastestPath(tree);
evaluateResult(result);
}
};
main();
\cleaning\bedtocloset.txt
does not matter
\cleaning\bedtotub.txt
does not matter
\cleaning\bookstopillows.txt
does not matter
\cleaning\bookstotable.txt
does not matter
\cleaning\closettopillows.txt
fastest:
time: 13.1
path: [ 1 ]
slowest:
time: 16.1
path: [ 2 ]
strategy:
timesave: 3.0000000000000018 seconds
route: [ 'Option 2' ]
\cleaning\closettotub.txt
does not matter
\cleaning\dishestotub.txt
does not matter
\cleaning\final.txt
does not matter
\cleaning\intro.txt
fastest:
time: 17
path: [ -1, 1 ]
slowest:
time: 20
path: [ -1, 2 ]
strategy:
timesave: 3 seconds
route: [ 'Option 2' ]
\cleaning\pillowstospill.txt
does not matter
\cleaning\spilltodishes.txt
fastest:
time: 12.1
path: [ -1, 2 ]
slowest:
time: 14.1
path: [ -1, 1 ]
time: 14.1
path: [ -1, 0 ]
strategy:
timesave: 2 seconds
route: [ 'Option 3' ]
\cleaning\tabletobed.txt
does not matter
\cleaning\tabletocloset.txt
fastest:
time: 12.1
path: [ 2 ]
slowest:
time: 13.1
path: [ 1 ]
time: 13.1
path: [ 0 ]
strategy:
timesave: 1 seconds
route: [ 'Option 3' ]
\cleaning\tabletopillows2.txt
does not matter
\cleaning\tubtobooks.txt
does not matter
\cleaning\tubtobooks2.txt
does not matter
\counselorspeak1.txt
does not matter
\crashthegame.txt
does not matter
\downinterview3.txt
fastest:
time: 32
path: [ -1, 0, -1, 0, -1, 0 ]
time: 32
path: [ -1, 0, -1, 1, -1, 0 ]
time: 32
path: [ -1, 0, -1, 0, -1, 1 ]
time: 32
path: [ -1, 1, -1, 0, -1, 0 ]
time: 32
path: [ -1, 0, -1, 0, -1, 2 ]
time: 32
path: [ -1, 0, -1, 1, -1, 1 ]
time: 32
path: [ -1, 2, -1, 0, -1, 0 ]
time: 32
path: [ -1, 1, -1, 0, -1, 1 ]
time: 32
path: [ -1, 1, -1, 1, -1, 0 ]
time: 32
path: [ -1, 2, -1, 0, -1, 1 ]
time: 32
path: [ -1, 1, -1, 1, -1, 1 ]
time: 32
path: [ -1, 1, -1, 0, -1, 2 ]
time: 32
path: [ -1, 2, -1, 1, -1, 0 ]
time: 32
path: [ -1, 2, -1, 0, -1, 2 ]
time: 32
path: [ -1, 2, -1, 1, -1, 1 ]
slowest:
time: 39
path: [ -1, 2, -1, 2, -1, 2 ]
time: 39
path: [ -1, 1, -1, 2, -1, 2 ]
time: 39
path: [ -1, 0, -1, 2, -1, 2 ]
strategy:
timesave: 7 seconds
route: [ 'Option 1', 'Option 1', 'Option 1' ]
\downinterview4.txt
does not matter
\machine1.txt
does not matter
\machine21.txt
fastest:
time: 23
path: [ 0, 0, 0, 0, 0, 0 ]
time: 23
path: [ 0, 0, 1, 0, 0, 0 ]
time: 23
path: [ 0, 0, 0, 1, 0, 0 ]
time: 23
path: [ 0, 1, 0, 0, 0, 0 ]
time: 23
path: [ 0, 0, 0, 0, 1, 0 ]
time: 23
path: [ 0, 0, 1, 1, 0, 0 ]
time: 23
path: [ 0, 0, 2, 0, 0, 0 ]
time: 23
path: [ 0, 0, 0, 1, 1, 0 ]
time: 23
path: [ 0, 2, 0, 0, 0, 0 ]
time: 23
path: [ 0, 1, 1, 0, 0, 0 ]
time: 23
path: [ 0, 1, 0, 0, 1, 0 ]
time: 23
path: [ 0, 1, 0, 1, 0, 0 ]
time: 23
path: [ 0, 0, 1, 0, 1, 0 ]
time: 23
path: [ 0, 0, 0, 0, 2, 0 ]
time: 23
path: [ 0, 0, 2, 1, 0, 0 ]
time: 23
path: [ 0, 2, 0, 0, 1, 0 ]
time: 23
path: [ 0, 1, 1, 1, 0, 0 ]
time: 23
path: [ 0, 0, 1, 1, 1, 0 ]
time: 23
path: [ 0, 2, 1, 0, 0, 0 ]
time: 23
path: [ 0, 1, 0, 0, 2, 0 ]
time: 23
path: [ 0, 2, 0, 1, 0, 0 ]
time: 23
path: [ 0, 1, 0, 1, 1, 0 ]
time: 23
path: [ 0, 1, 2, 0, 0, 0 ]
time: 23
path: [ 0, 0, 0, 1, 2, 0 ]
time: 23
path: [ 0, 0, 1, 0, 2, 0 ]
time: 23
path: [ 0, 1, 1, 0, 1, 0 ]
time: 23
path: [ 0, 0, 2, 0, 1, 0 ]
time: 23
path: [ 0, 2, 1, 1, 0, 0 ]
time: 23
path: [ 0, 2, 1, 0, 1, 0 ]
time: 23
path: [ 0, 1, 1, 1, 1, 0 ]
time: 23
path: [ 0, 0, 2, 0, 2, 0 ]
time: 23
path: [ 0, 0, 1, 1, 2, 0 ]
time: 23
path: [ 0, 1, 0, 1, 2, 0 ]
time: 23
path: [ 0, 1, 2, 0, 1, 0 ]
time: 23
path: [ 0, 0, 2, 1, 1, 0 ]
time: 23
path: [ 0, 2, 0, 0, 2, 0 ]
time: 23
path: [ 0, 2, 2, 0, 0, 0 ]
time: 23
path: [ 0, 2, 0, 1, 1, 0 ]
time: 23
path: [ 0, 1, 1, 0, 2, 0 ]
time: 23
path: [ 0, 1, 2, 1, 0, 0 ]
time: 23
path: [ 0, 0, 2, 1, 2, 0 ]
time: 23
path: [ 0, 2, 0, 1, 2, 0 ]
time: 23
path: [ 0, 1, 1, 1, 2, 0 ]
time: 23
path: [ 0, 2, 1, 1, 1, 0 ]
time: 23
path: [ 0, 1, 2, 0, 2, 0 ]
time: 23
path: [ 0, 2, 2, 0, 1, 0 ]
time: 23
path: [ 0, 1, 2, 1, 1, 0 ]
time: 23
path: [ 0, 2, 1, 0, 2, 0 ]
time: 23
path: [ 0, 2, 2, 1, 0, 0 ]
time: 23
path: [ 0, 2, 2, 0, 2, 0 ]
time: 23
path: [ 0, 2, 2, 1, 1, 0 ]
time: 23
path: [ 0, 2, 1, 1, 2, 0 ]
time: 23
path: [ 0, 1, 2, 1, 2, 0 ]
time: 23
path: [ 0, 2, 2, 1, 2, 0 ]
slowest:
time: 25
path: [ 0, 2, 2, 2, 0, 2, 0 ]
time: 25
path: [ 0, 1, 2, 2, 0, 2, 0 ]
time: 25
path: [ 0, 2, 2, 2, 0, 1, 0 ]
time: 25
path: [ 0, 2, 1, 2, 0, 2, 0 ]
time: 25
path: [ 0, 2, 2, 2, 0, 0, 0 ]
time: 25
path: [ 0, 1, 2, 2, 0, 1, 0 ]
time: 25
path: [ 0, 2, 0, 2, 0, 2, 0 ]
time: 25
path: [ 0, 2, 1, 2, 0, 1, 0 ]
time: 25
path: [ 0, 1, 1, 2, 0, 2, 0 ]
time: 25
path: [ 0, 0, 2, 2, 0, 2, 0 ]
time: 25
path: [ 0, 1, 0, 2, 0, 2, 0 ]
time: 25
path: [ 0, 1, 1, 2, 0, 1, 0 ]
time: 25
path: [ 0, 0, 1, 2, 0, 2, 0 ]
time: 25
path: [ 0, 0, 2, 2, 0, 1, 0 ]
time: 25
path: [ 0, 2, 1, 2, 0, 0, 0 ]
time: 25
path: [ 0, 1, 2, 2, 0, 0, 0 ]
time: 25
path: [ 0, 2, 0, 2, 0, 1, 0 ]
time: 25
path: [ 0, 1, 0, 2, 0, 1, 0 ]
time: 25
path: [ 0, 1, 1, 2, 0, 0, 0 ]
time: 25
path: [ 0, 0, 2, 2, 0, 0, 0 ]
time: 25
path: [ 0, 0, 1, 2, 0, 1, 0 ]
time: 25
path: [ 0, 0, 0, 2, 0, 2, 0 ]
time: 25
path: [ 0, 2, 0, 2, 0, 0, 0 ]
time: 25
path: [ 0, 0, 1, 2, 0, 0, 0 ]
time: 25
path: [ 0, 1, 0, 2, 0, 0, 0 ]
time: 25
path: [ 0, 0, 0, 2, 0, 1, 0 ]
time: 25
path: [ 0, 0, 0, 2, 0, 0, 0 ]
strategy:
timesave: 2 seconds
route: [ 'Option 1',
'Option 1',
'Option 1',
'Option 1',
'Option 1',
'Option 1' ]
\machine22.txt
does not matter
\machine4.txt
does not matter
\machine_weapon.txt
does not matter
\mobius1.txt
fastest:
time: 1
path: [ 1 ]
slowest:
time: 2
path: [ 2 ]
time: 2
path: [ 0 ]
strategy:
timesave: 1 seconds
route: [ 'Option 2' ]
\mobius2.txt
does not matter
\mobius3.txt
does not matter
\mobius4.txt
does not matter
\mobiusplayer1.txt
does not matter
\mobius_truth2.txt
does not matter
\mobius_truth3.txt
does not matter
\mobius_truth4.txt
does not matter
\mobius_truth5.txt
does not matter
\mobius_truth6.txt
does not matter
\mobius_truth7.txt
does not matter
\presence\p2ta.txt
fastest:
time: 10
path: [ -1, 2 ]
slowest:
time: 15
path: [ -1, 1, -1, 2 ]
time: 15
path: [ -1, 0, -1, 2 ]
strategy:
timesave: 5 seconds
route: [ 'Option 3' ]
\presence\p2tb.txt
fastest:
time: 10.5
path: [ -1, 1, -1, 0 ]
slowest:
time: 14.5
path: [ -1, 1, -1, 2, -1, 0 ]
time: 14.5
path: [ -1, 1, -1, 1, -1, 0 ]
strategy:
timesave: 4 seconds
route: [ 'Option 2', 'Option 1' ]
\presence\p2tc.txt
fastest:
time: 5.5
path: [ -1, 0 ]
slowest:
time: 9.5
path: [ -1, 2, -1, 0 ]
time: 9.5
path: [ -1, 1, -1, 0 ]
strategy:
timesave: 4 seconds
route: [ 'Option 1' ]
\presence\presence1.txt
does not matter
\presence\presence2.txt
does not matter
\presence\presence2a.txt
does not matter
\presence\presence3a.txt
does not matter
\presence\presence4a.txt
does not matter
\presence\presence4b.txt
does not matter
\presence\presence5.txt
does not matter
\presence\presencefinale.txt
does not matter
\presence\presencepuzzle1.txt
fastest:
time: 16.5
path: [ -1, 0, -1, 1, -1, 0 ]
time: 16.5
path: [ -1, 1, -1, 1, -1, 0 ]
time: 16.5
path: [ -1, 2, -1, 1, -1, 0 ]
slowest:
time: 25.5
path: [ -1, 2, -1, 2, -1, 1, -1, 2, -1, 0 ]
time: 25.5
path: [ -1, 1, -1, 2, -1, 1, -1, 2, -1, 0 ]
time: 25.5
path: [ -1, 2, -1, 2, -1, 1, -1, 1, -1, 0 ]
time: 25.5
path: [ -1, 1, -1, 2, -1, 1, -1, 1, -1, 0 ]
time: 25.5
path: [ -1, 0, -1, 2, -1, 1, -1, 2, -1, 0 ]
time: 25.5
path: [ -1, 2, -1, 0, -1, 1, -1, 2, -1, 0 ]
time: 25.5
path: [ -1, 1, -1, 0, -1, 1, -1, 2, -1, 0 ]
time: 25.5
path: [ -1, 0, -1, 2, -1, 1, -1, 1, -1, 0 ]
time: 25.5
path: [ -1, 2, -1, 0, -1, 1, -1, 1, -1, 0 ]
time: 25.5
path: [ -1, 0, -1, 0, -1, 1, -1, 2, -1, 0 ]
time: 25.5
path: [ -1, 1, -1, 0, -1, 1, -1, 1, -1, 0 ]
time: 25.5
path: [ -1, 0, -1, 0, -1, 1, -1, 1, -1, 0 ]
strategy:
timesave: 9 seconds
route: [ 'Option 1', 'Option 2', 'Option 1' ]
\prisonfurniture1.txt
does not matter
\prisonphone2.txt
fastest:
time: 63
path: [ -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 1, -1, 0, -1, 0, -1, 0 ]
time: 63
path: [ -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 1, -1, 0, -1, 1, -1, 0 ]
time: 63
path: [ -1, 0, -1, 0, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 0, -1, 0 ]
time: 63
path: [ -1, 0, -1, 1, -1, 0, -1, 0, -1, 0, -1, 1, -1, 0, -1, 0, -1, 0 ]
time: 63
path: [ -1, 0, -1, 1, -1, 0, -1, 0, -1, 0, -1, 1, -1, 0, -1, 1, -1, 0 ]
time: 63
path: [ -1, 0, -1, 0, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 1, -1, 0 ]
time: 63
path: [ -1, 0, -1, 0, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0, -1, 0, -1, 0 ]
time: 63
path: [ -1, 0, -1, 2, -1, 0, -1, 0, -1, 0, -1, 1, -1, 0, -1, 0, -1, 0 ]
time: 63
path: [ -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 1, -1, 0, -1, 2, -1, 0 ]
time: 63
path: [ -1, 0, -1, 1, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 0, -1, 0 ]
time: 63
path: [ -1, 0, -1, 2, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 0, -1, 0 ]
time: 63
path: [ -1, 0, -1, 1, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 1, -1, 0 ]
time: 63
path: [ -1, 0, -1, 0, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0, -1, 1, -1, 0 ]
time: 63
path: [ -1, 0, -1, 2, -1, 0, -1, 0, -1, 0, -1, 1, -1, 0, -1, 1, -1, 0 ]
time: 63
path: [ -1, 0, -1, 1, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0, -1, 0, -1, 0 ]
time: 63
path: [ -1, 0, -1, 0, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 2, -1, 0 ]
time: 63
path: [ -1, 0, -1, 1, -1, 0, -1, 0, -1, 0, -1, 1, -1, 0, -1, 2, -1, 0 ]
time: 63
path: [ -1, 0, -1, 2, -1, 0, -1, 0, -1, 0, -1, 1, -1, 0, -1, 2, -1, 0 ]
time: 63
path: [ -1, 0, -1, 2, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 1, -1, 0 ]
time: 63
path: [ -1, 0, -1, 1, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0, -1, 1, -1, 0 ]
time: 63
path: [ -1, 0, -1, 1, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 2, -1, 0 ]
time: 63
path: [ -1, 0, -1, 0, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0, -1, 2, -1, 0 ]
time: 63
path: [ -1, 0, -1, 2, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0, -1, 0, -1, 0 ]
time: 63
path: [ -1, 0, -1, 2, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0, -1, 1, -1, 0 ]
time: 63
path: [ -1, 0, -1, 2, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 2, -1, 0 ]
time: 63
path: [ -1, 0, -1, 1, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0, -1, 2, -1, 0 ]
time: 63
path: [ -1, 0, -1, 2, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0, -1, 2, -1, 0 ]
slowest:
time: 76
path: [ -1, 0, -1, 2, -1, 1, -1, 2, -1, 2, -1, 0, -1, 2, -1, 2, -1, 0 ]
time: 76
path: [ -1, 0, -1, 2, -1, 1, -1, 2, -1, 1, -1, 0, -1, 2, -1, 2, -1, 0 ]
time: 76
path: [ -1, 0, -1, 2, -1, 1, -1, 2, -1, 2, -1, 0, -1, 2, -1, 1, -1, 0 ]
time: 76
path: [ -1, 0, -1, 1, -1, 1, -1, 2, -1, 2, -1, 0, -1, 2, -1, 2, -1, 0 ]
time: 76
path: [ -1, 0, -1, 2, -1, 1, -1, 2, -1, 1, -1, 0, -1, 2, -1, 1, -1, 0 ]
time: 76
path: [ -1, 0, -1, 2, -1, 1, -1, 2, -1, 0, -1, 0, -1, 2, -1, 2, -1, 0 ]
time: 76
path: [ -1, 0, -1, 2, -1, 1, -1, 2, -1, 2, -1, 0, -1, 2, -1, 0, -1, 0 ]
time: 76
path: [ -1, 0, -1, 1, -1, 1, -1, 2, -1, 2, -1, 0, -1, 2, -1, 1, -1, 0 ]
time: 76
path: [ -1, 0, -1, 0, -1, 1, -1, 2, -1, 2, -1, 0, -1, 2, -1, 2, -1, 0 ]
time: 76
path: [ -1, 0, -1, 1, -1, 1, -1, 2, -1, 1, -1, 0, -1, 2, -1, 2, -1, 0 ]
time: 76
path: [ -1, 0, -1, 0, -1, 1, -1, 2, -1, 1, -1, 0, -1, 2, -1, 2, -1, 0 ]
time: 76
path: [ -1, 0, -1, 1, -1, 1, -1, 2, -1, 1, -1, 0, -1, 2, -1, 1, -1, 0 ]
time: 76
path: [ -1, 0, -1, 2, -1, 1, -1, 2, -1, 1, -1, 0, -1, 2, -1, 0, -1, 0 ]
time: 76
path: [ -1, 0, -1, 2, -1, 1, -1, 2, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0 ]
time: 76
path: [ -1, 0, -1, 1, -1, 1, -1, 2, -1, 0, -1, 0, -1, 2, -1, 2, -1, 0 ]
time: 76
path: [ -1, 0, -1, 1, -1, 1, -1, 2, -1, 2, -1, 0, -1, 2, -1, 0, -1, 0 ]
time: 76
path: [ -1, 0, -1, 0, -1, 1, -1, 2, -1, 2, -1, 0, -1, 2, -1, 1, -1, 0 ]
time: 76
path: [ -1, 0, -1, 1, -1, 1, -1, 2, -1, 1, -1, 0, -1, 2, -1, 0, -1, 0 ]
time: 76
path: [ -1, 0, -1, 0, -1, 1, -1, 2, -1, 0, -1, 0, -1, 2, -1, 2, -1, 0 ]
time: 76
path: [ -1, 0, -1, 1, -1, 1, -1, 2, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0 ]
time: 76
path: [ -1, 0, -1, 0, -1, 1, -1, 2, -1, 2, -1, 0, -1, 2, -1, 0, -1, 0 ]
time: 76
path: [ -1, 0, -1, 0, -1, 1, -1, 2, -1, 1, -1, 0, -1, 2, -1, 1, -1, 0 ]
time: 76
path: [ -1, 0, -1, 2, -1, 1, -1, 2, -1, 0, -1, 0, -1, 2, -1, 0, -1, 0 ]
time: 76
path: [ -1, 0, -1, 0, -1, 1, -1, 2, -1, 1, -1, 0, -1, 2, -1, 0, -1, 0 ]
time: 76
path: [ -1, 0, -1, 1, -1, 1, -1, 2, -1, 0, -1, 0, -1, 2, -1, 0, -1, 0 ]
time: 76
path: [ -1, 0, -1, 0, -1, 1, -1, 2, -1, 0, -1, 0, -1, 2, -1, 1, -1, 0 ]
time: 76
path: [ -1, 0, -1, 0, -1, 1, -1, 2, -1, 0, -1, 0, -1, 2, -1, 0, -1, 0 ]
strategy:
timesave: 13 seconds
route: [ 'Option 1',
'Option 1',
'Option 1',
'Option 1',
'Option 1',
'Option 2',
'Option 1',
'Option 1',
'Option 1' ]
\reset.txt
does not matter
\theater1.txt
does not matter
\theater2.txt
fastest:
time: 79
path: [ -1, 1, -1, 0, -1, 0 ]
time: 79
path: [ -1, 1, -1, 1, -1, 0 ]
time: 79
path: [ -1, 1, -1, 0, -1, 1 ]
time: 79
path: [ -1, 1, -1, 1, -1, 1 ]
time: 79
path: [ -1, 1, -1, 2, -1, 0 ]
time: 79
path: [ -1, 1, -1, 0, -1, 2 ]
time: 79
path: [ -1, 1, -1, 2, -1, 1 ]
time: 79
path: [ -1, 1, -1, 1, -1, 2 ]
time: 79
path: [ -1, 1, -1, 2, -1, 2 ]
slowest:
time: 80
path: [ -1, 2, -1, 2, -1, 2 ]
time: 80
path: [ -1, 2, -1, 2, -1, 1 ]
time: 80
path: [ -1, 2, -1, 1, -1, 2 ]
time: 80
path: [ -1, 0, -1, 2, -1, 2 ]
time: 80
path: [ -1, 2, -1, 2, -1, 0 ]
time: 80
path: [ -1, 2, -1, 1, -1, 1 ]
time: 80
path: [ -1, 2, -1, 0, -1, 2 ]
time: 80
path: [ -1, 0, -1, 2, -1, 1 ]
time: 80
path: [ -1, 0, -1, 1, -1, 2 ]
time: 80
path: [ -1, 2, -1, 0, -1, 1 ]
time: 80
path: [ -1, 2, -1, 1, -1, 0 ]
time: 80
path: [ -1, 0, -1, 1, -1, 1 ]
time: 80
path: [ -1, 2, -1, 0, -1, 0 ]
time: 80
path: [ -1, 0, -1, 2, -1, 0 ]
time: 80
path: [ -1, 0, -1, 0, -1, 2 ]
time: 80
path: [ -1, 0, -1, 0, -1, 1 ]
time: 80
path: [ -1, 0, -1, 1, -1, 0 ]
time: 80
path: [ -1, 0, -1, 0, -1, 0 ]
strategy:
timesave: 1 seconds
route: [ 'Option 2', 'Option 1', 'Option 1' ]
\theater3.txt
does not matter
\typewriters.txt
does not matter
\workshop2.txt
does not matter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment