Clean up & add yes utility

This commit is contained in:
joachimschmidt557 2019-03-07 16:24:29 +01:00
parent cdb226da8c
commit c4a8616344
7 changed files with 28 additions and 7 deletions

7
.gitignore vendored
View file

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

BIN
echo

Binary file not shown.

11
factor.nim Normal file
View file

@ -0,0 +1,11 @@
import cligen
import common
proc factor(num:int):seq[int] =
result = @[0]
proc main(integers:seq[int]) =
for number in integers:
echo number, ": ", factor(number)
dispatch(main)

BIN
mul

Binary file not shown.

View file

@ -6,4 +6,7 @@ license = "Unlicense"
requires "nim >= 0.19.0"
requires "cligen >= 0.9.19"
bin = @["add", "echo", "false", "mul", "seq", "sleep", "sub", "true"]
bin = @["add", "echo", "factor", "false", "mul", "seq", "sleep", "sub", "true", "yes"]
binDir = "bin"

BIN
sub

Binary file not shown.

12
yes.nim Normal file
View file

@ -0,0 +1,12 @@
import cligen, sequtils
import common
proc main(strings:seq[string]) =
if strings.len == 0:
while true:
echo "y"
else:
while true:
echo strings.foldl(a & b)
dispatch(main, version=("version", nimbaseVersion))