diff --git a/.gitignore b/.gitignore index 2599970..491da0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -stockers \ No newline at end of file +./stockers \ No newline at end of file diff --git a/src/stockers.nim b/src/stockers.nim index 1476aa4..af48ec1 100644 --- a/src/stockers.nim +++ b/src/stockers.nim @@ -7,55 +7,59 @@ when isMainModule: proc casesPerMinute(name: string): string = var acases: float var aminutes: float + while true == true: - #stdout.write("Name of employee: ") - #name = readLine(stdin) + #stdout.write("Name of employee: ") + #name = readLine(stdin) - stdout.write(fmt"Number of cases for {name}: ") - var cases = readLine(stdin) + stdout.write(fmt"Number of cases for {name}: ") + var cases = readLine(stdin) - if cases == "q": - quit(0) - - if re"[^0-9.]" in cases: - echo "I can't do math on words, fucking moron" - quit(1) - else: - acases = cases.parseFloat() + if cases == "q": + quit(0) - stdout.write(fmt"Number of hours or minutes it took: ") - var minutes = readLine(stdin) + if cases == "m": + echo "TBI" - if minutes == "q": - quit(0) + if re"[^0-9.]" in cases: + echo "I can't do math on words, fucking moron" + quit(1) + else: + acases = cases.parseFloat() - if re"[^0-9.]" in minutes: - echo "I can't do math on words, fucking moron" - quit(1) - else: - aminutes = minutes.parseFloat() - if aminutes < 10: - aminutes = aminutes * 60 + stdout.write(fmt"Number of hours or minutes it took: ") + var minutes = readLine(stdin) + + if minutes == "q": + quit(0) + + if re"[^0-9.]" in minutes: + echo "I can't do math on words, fucking moron" + quit(1) + else: + aminutes = minutes.parseFloat() + if aminutes < 10: + aminutes = aminutes * 60 - let cpm: float = acases / aminutes + let cpm: float = acases / aminutes - return(fmt"{name} can throw: {cpm:2.2f} cases per minute") + echo (fmt"{name} can throw: {cpm:2.2f} cases per minute") proc options(name: string) = echo(fmt""" -Properties of {name} + Properties of {name} -1) Cases per minute -q) Quit - - """) + 1) Cases per minute + q) Quit + + """) stdout.write("Choose a property: ") var property = readLine(stdin) @@ -67,24 +71,25 @@ q) Quit echo("That is not a property") - proc mainScreen() = - echo(fmt""" - ------------ - | Stockers | - | v0.1.0 | - ------------ + proc mainScreen*() = -1) Leroy -2) Perez -3) Eric -4) Emiliano -5) Jamal -6) Joseph -7) Justin -8) Lee -q) Quit + echo(fmt""" + ------------ + | Stockers | + | v0.1.0 | + ------------ + + 1) Leroy + 2) Perez + 3) Eric + 4) Emiliano + 5) Jamal + 6) Joseph + 7) Justin + 8) Lee + q) Quit - """) + """) stdout.write("Choose an employee: ") var employee = readLine(stdin) @@ -109,5 +114,5 @@ q) Quit quit(0) else: echo(fmt"{employee} is not listed above") - - mainScreen() \ No newline at end of file + while true == true: + mainScreen() diff --git a/stockers b/stockers deleted file mode 100755 index 3bad776..0000000 Binary files a/stockers and /dev/null differ