mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 05:43:53 +01:00
14 lines
324 B
Plaintext
14 lines
324 B
Plaintext
total := 0.0
|
|
loop {
|
|
("Total: ", total, ". Type a number to change.").concat.println
|
|
().read_line.try(
|
|
(line) -> line.trim.parse_float.try(
|
|
(n) -> &total = (total, n).sum
|
|
() -> "Not a number".eprintln
|
|
)
|
|
// CTRL+D, so return a 1-tuple to break from the loop
|
|
() -> (())
|
|
)
|
|
}
|
|
"Goodbye.".println
|