about summary refs log tree commit diff
path: root/thinkperl6/human-seconds.p6
diff options
context:
space:
mode:
authorNguyễn Gia Phong <vn.mcsinyx@gmail.com>2018-12-25 23:28:43 +0700
committerNguyễn Gia Phong <vn.mcsinyx@gmail.com>2018-12-25 23:28:43 +0700
commit8d090c241f25b226a6533e066e5e7e21738d70be (patch)
tree246608730dc65cab821496e331d230218c8c7802 /thinkperl6/human-seconds.p6
parent5e48d2ec45a065cc81781995bf461415563da086 (diff)
downloadcp-8d090c241f25b226a6533e066e5e7e21738d70be.tar.gz
Merry Chistmas or other holiday of your choice
Diffstat (limited to 'thinkperl6/human-seconds.p6')
-rwxr-xr-xthinkperl6/human-seconds.p68
1 files changed, 8 insertions, 0 deletions
diff --git a/thinkperl6/human-seconds.p6 b/thinkperl6/human-seconds.p6
new file mode 100755
index 0000000..a7b2165
--- /dev/null
+++ b/thinkperl6/human-seconds.p6
@@ -0,0 +1,8 @@
+#!/usr/bin/env perl6
+# Exercise 4.1
+sub MAIN(Int $seconds=240_000) {
+    put 'Days: ', $seconds div 86400;
+    put 'Hours: ', $seconds div 3600 % 24;
+    put 'Minutes: ', $seconds div 60 % 60;
+    put 'Seconds: ', $seconds % 60
+}