mirror of
https://github.com/cupcakearmy/advent-of-code.git
synced 2025-09-03 22:00:40 +00:00
add ts
This commit is contained in:
@@ -6,9 +6,7 @@ unless_exists: true
|
||||
|
||||
from os.path import join, dirname
|
||||
|
||||
# Day <%= day %>
|
||||
|
||||
# Common
|
||||
# Setup
|
||||
|
||||
|
||||
def read_input(filename):
|
||||
@@ -17,7 +15,25 @@ def read_input(filename):
|
||||
return f.read().strip()
|
||||
|
||||
|
||||
test = read_input('test.txt')
|
||||
data = read_input('input.txt')
|
||||
TEST = read_input('test.txt')
|
||||
INPUT = read_input('input.txt')
|
||||
|
||||
# Task
|
||||
|
||||
def part_a(raw: str):
|
||||
pass
|
||||
|
||||
|
||||
def part_b(raw: str):
|
||||
pass
|
||||
|
||||
# Running
|
||||
|
||||
print('1.')
|
||||
print(part_a(TEST))
|
||||
print(part_a(INPUT))
|
||||
|
||||
print('\n2.')
|
||||
print('1.')
|
||||
print(part_b(TEST))
|
||||
print(part_b(INPUT))
|
||||
|
24
_templates/riddle/new/typescript.ejs.t
Normal file
24
_templates/riddle/new/typescript.ejs.t
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
to: <%= dir %>/typescript/main.ts
|
||||
unless_exists: true
|
||||
---
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
// SETUP
|
||||
const INPUT = fs.readFileSync(path.join(__dirname, '../input.txt'), 'utf-8').trim()
|
||||
const TEST = fs.readFileSync(path.join(__dirname, '../test.txt'), 'utf-8').trim()
|
||||
|
||||
// TASK
|
||||
|
||||
function partA(input: string) {}
|
||||
|
||||
function partB(input: string) {}
|
||||
|
||||
console.log('Part A:')
|
||||
partA(TEST)
|
||||
partA(INPUT)
|
||||
|
||||
console.log('Part B:')
|
||||
partA(TEST)
|
||||
partB(INPUT)
|
Reference in New Issue
Block a user