multrix/src/main.nim
array-in-a-matrix 612a15fd5e better readme
2023-01-16 16:43:28 -05:00

32 lines
815 B
Nim

import strutils, os, procedures
var operation: string
var argument: string
if paramCount() > 0:
argument = toLowerAscii(paramStr(1))
#? if command is "dot" or "cross" preform that operation
if paramStr(0).endsWith("/dot") or paramStr(0) == "dot" or argument == "dot" or argument == "d":
operation = "dot"
dot()
elif paramStr(0).endsWith("/cross") or paramStr(0) == "cross" or argument == "cross" or argument == "c":
operation = "cross"
cross()
else:
echo "Would you like to preform the dot or cross product?"
operation = toLowerAscii(readLine(stdin))
case operation:
of "dot":
dot()
of "d":
dot()
of "cross":
cross()
of "c":
cross()
else:
quit "Invalid operation!", QuitFailure