Rdy for day 3
This commit is contained in:
parent
97fa7bc7d7
commit
96c9388d84
|
@ -18,7 +18,7 @@
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"runtimeExecutable": "yarn",
|
"runtimeExecutable": "yarn",
|
||||||
"runtimeArgs": ["run", "test"],
|
"runtimeArgs": ["run", "test"],
|
||||||
"program": "${workspaceFolder}/dist/2020-day-02.js",
|
"program": "${workspaceFolder}/dist/2020-day-03.js",
|
||||||
"outFiles": [
|
"outFiles": [
|
||||||
"${workspaceFolder}/dist/**/*.js"
|
"${workspaceFolder}/dist/**/*.js"
|
||||||
],
|
],
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
import 'mocha';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { readFileSync } from 'fs';
|
||||||
|
|
||||||
|
|
||||||
|
let input = readFileSync('./input/2020-day-03.txt', 'utf-8')
|
||||||
|
.split('\n')
|
||||||
|
.map(l => parseInt(l.trim(), 10));
|
||||||
|
|
||||||
|
let example: number[] = []
|
||||||
|
let tasksResults: any[] = ['N/A', 'N/A'];
|
||||||
|
|
||||||
|
describe('Day 02', () => {
|
||||||
|
describe('task01', () => {
|
||||||
|
it('Calculate', () => {
|
||||||
|
assert.strictEqual(task01(example), 0);
|
||||||
|
tasksResults[0] = task01(input)
|
||||||
|
});
|
||||||
|
});
|
||||||
|
describe('test02', () => {
|
||||||
|
it('Calculate', () => {
|
||||||
|
assert.strictEqual(task02(input), 0);
|
||||||
|
tasksResults[1] = task02(input);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
after(() => {
|
||||||
|
console.log('\ntask 01:', tasksResults[0]);
|
||||||
|
console.log('\ntask 02:', tasksResults[1]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function task01(input: number[]): number {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function task02(input: number[]): number {
|
||||||
|
return task01(input);
|
||||||
|
}
|
Loading…
Reference in New Issue