multrix/src/main.nim
array-in-a-matrix 4004ecb9e0 refactor
2023-01-16 20:21:53 -05:00

23 lines
535 B
Nim

import strutils, os, procedures
var argument: string
if paramCount() > 0:
argument = toLowerAscii(paramStr(1))
let args = [paramStr(0).splitPath.tail, paramStr(0), argument]
if "dot" in args or "d" in args:
dot()
elif "cross" in args or "c" in args:
cross()
else:
echo "Would you like to preform the dot or cross product?"
case toLowerAscii(readLine(stdin)):
of "dot", "d":
dot()
of "cross", "c":
cross()
else:
quit "Invalid operation!", QuitFailure