From f3be246c4e7d79df669fbf3c48710620d1c361d5 Mon Sep 17 00:00:00 2001 From: j-james Date: Wed, 30 Nov 2022 12:32:17 -0800 Subject: Update Nim template --- 2022/main.nim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to '2022') diff --git a/2022/main.nim b/2022/main.nim index 9960bf9..15ba6b9 100644 --- a/2022/main.nim +++ b/2022/main.nim @@ -1,12 +1,16 @@ # Day ???: ??? -import std/[os, strutils, sequtils, sugar, enumerate] +import std/[os, strutils, sequtils, sugar] # import std/[algorithm, math, hashes, tables, sets] -# import std/[strformat, strscans] +# import std/[strformat, strscans, enumerate] # useful functions and things to remember: # - readFile, splitLines, split(""), strip({''}) # - map(func), filter(func), all(func), any(func) # - foldl(func, init), string.repeat(count), zip(a, b) # for i, chr in "string": assert "string"[i] == chr +# assert @[0, 1, 2, 3] == collect(for i in 0..3: i) -let input: string = paramStr(1).readFile() +let input = paramStr(1).readFile().strip().split("\n") + +for line in input: + discard -- cgit v1.2.3-70-g09d2