32 lines
822 B
Nim
32 lines
822 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 matrix operation!", QuitFailure
|
|
|