Initial files

This commit is contained in:
joachimschmidt557 2019-03-07 14:10:32 +01:00
commit 7779e36f86
7 changed files with 47 additions and 0 deletions

6
.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
add
false
nakefile
seq
sleep
true

6
add.nim Normal file
View file

@ -0,0 +1,6 @@
import cligen, sequtils
proc main(integers:seq[int]) =
echo integers.foldl(a + b)
dispatch(main)

6
false.nim Normal file
View file

@ -0,0 +1,6 @@
import cligen
proc main() =
system.quit(1)
dispatch(main)

8
nakefile.nim Normal file
View file

@ -0,0 +1,8 @@
import nake
task "compile", "Compile nimbase":
discard shell(nimExe, "c", "true.nim")
discard shell(nimExe, "c", "false.nim")
discard shell(nimExe, "c", "sleep.nim")
discard shell(nimExe, "c", "seq.nim")
discard shell(nimExe, "c", "add.nim")

9
seq.nim Normal file
View file

@ -0,0 +1,9 @@
import cligen
proc main(last:int, first=1, increment=1) =
var i = first
while i <= last:
echo(i)
i = i + increment
dispatch(main)

6
sleep.nim Normal file
View file

@ -0,0 +1,6 @@
import os, cligen, sequtils
proc main(secs:seq[int]) =
sleep(secs.foldl(a + b) * 1000)
dispatch(main)

6
true.nim Normal file
View file

@ -0,0 +1,6 @@
import cligen
proc main() =
system.quit(0)
dispatch(main)