Init
This commit is contained in:
commit
4ff6e01337
41
src/stockers.nim
Normal file
41
src/stockers.nim
Normal file
@ -0,0 +1,41 @@
|
||||
import strutils
|
||||
import regex
|
||||
import strformat
|
||||
|
||||
when isMainModule:
|
||||
var acases: float
|
||||
var aminutes: float
|
||||
var name: string
|
||||
var time_tail = "hours"
|
||||
|
||||
stdout.write("Name of employee: ")
|
||||
name = readLine(stdin)
|
||||
|
||||
stdout.write("Number of cases: ")
|
||||
var cases = readLine(stdin)
|
||||
|
||||
|
||||
|
||||
if re"[^0-9.]" in cases:
|
||||
echo "I can't do math on words, fucking moron"
|
||||
quit(1)
|
||||
else:
|
||||
acases = cases.parseFloat()
|
||||
|
||||
stdout.write("Number of minutes it took: ")
|
||||
var minutes = readLine(stdin)
|
||||
|
||||
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
|
||||
|
||||
|
||||
echo(fmt"{name} can throw: {cpm:2.2f} cases per minute")
|
15
stockers.nimble
Normal file
15
stockers.nimble
Normal file
@ -0,0 +1,15 @@
|
||||
# Package
|
||||
|
||||
version = "0.1.0"
|
||||
author = "mollusk"
|
||||
description = "Calculate various numbers about aisle stocking"
|
||||
license = "ISC"
|
||||
srcDir = "src"
|
||||
bin = @["stockers"]
|
||||
|
||||
|
||||
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 1.0.4"
|
||||
requires "regex >= 0.13.0"
|
Loading…
x
Reference in New Issue
Block a user