Use loop for menus
This commit is contained in:
parent
c6e71553ab
commit
78ea5d261e
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
|||||||
stockers
|
./stockers
|
@ -7,6 +7,7 @@ when isMainModule:
|
|||||||
proc casesPerMinute(name: string): string =
|
proc casesPerMinute(name: string): string =
|
||||||
var acases: float
|
var acases: float
|
||||||
var aminutes: float
|
var aminutes: float
|
||||||
|
while true == true:
|
||||||
|
|
||||||
#stdout.write("Name of employee: ")
|
#stdout.write("Name of employee: ")
|
||||||
#name = readLine(stdin)
|
#name = readLine(stdin)
|
||||||
@ -17,6 +18,9 @@ when isMainModule:
|
|||||||
if cases == "q":
|
if cases == "q":
|
||||||
quit(0)
|
quit(0)
|
||||||
|
|
||||||
|
if cases == "m":
|
||||||
|
echo "TBI"
|
||||||
|
|
||||||
if re"[^0-9.]" in cases:
|
if re"[^0-9.]" in cases:
|
||||||
echo "I can't do math on words, fucking moron"
|
echo "I can't do math on words, fucking moron"
|
||||||
quit(1)
|
quit(1)
|
||||||
@ -42,7 +46,7 @@ when isMainModule:
|
|||||||
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")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -67,7 +71,8 @@ q) Quit
|
|||||||
echo("That is not a property")
|
echo("That is not a property")
|
||||||
|
|
||||||
|
|
||||||
proc mainScreen() =
|
proc mainScreen*() =
|
||||||
|
|
||||||
echo(fmt"""
|
echo(fmt"""
|
||||||
------------
|
------------
|
||||||
| Stockers |
|
| Stockers |
|
||||||
@ -109,5 +114,5 @@ q) Quit
|
|||||||
quit(0)
|
quit(0)
|
||||||
else:
|
else:
|
||||||
echo(fmt"{employee} is not listed above")
|
echo(fmt"{employee} is not listed above")
|
||||||
|
while true == true:
|
||||||
mainScreen()
|
mainScreen()
|
Loading…
x
Reference in New Issue
Block a user