Clean up & add yes utility
This commit is contained in:
parent
cdb226da8c
commit
c4a8616344
7 changed files with 28 additions and 7 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -1,6 +1 @@
|
||||||
add
|
bin/
|
||||||
false
|
|
||||||
nakefile
|
|
||||||
seq
|
|
||||||
sleep
|
|
||||||
true
|
|
||||||
BIN
echo
BIN
echo
Binary file not shown.
11
factor.nim
Normal file
11
factor.nim
Normal 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
BIN
mul
Binary file not shown.
|
|
@ -6,4 +6,7 @@ license = "Unlicense"
|
||||||
|
|
||||||
requires "nim >= 0.19.0"
|
requires "nim >= 0.19.0"
|
||||||
requires "cligen >= 0.9.19"
|
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
BIN
sub
Binary file not shown.
12
yes.nim
Normal file
12
yes.nim
Normal 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))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue