-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.js
More file actions
37 lines (29 loc) · 792 Bytes
/
template.js
File metadata and controls
37 lines (29 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'use strict'
const { assert, loadData, parseInt } = require('./core/utils')
const rawInput = [loadData(module.filename)]
/**
* @param {string[]} data
* @param {boolean} isDemoTask
*/
const puzzle1 = (data, isDemoTask) => {
}
/**
* @param {string[]} data
* @param {boolean} isDemoTask
*/
const puzzle2 = (data, isDemoTask) => {
}
const parse = (dsn) => {
let data = rawInput[dsn]
if (data && (data = data.split('\n').filter(v => Boolean(v))).length) {
return data
}
return data // NOTE: The runner will distinguish between undefined and falsy!
}
// Example (demo) data.
rawInput[1] = ``
// Uncomment the next line to disable demo for puzzle2 or to define different demo for it.
// rawInput[2] = ``
module.exports = { parse, puzzles: [puzzle1, puzzle2] }
/*
*/