Worthwhile task shaving: Difference between revisions

m
syntax highlighting fixup automation
No edit summary
m (syntax highlighting fixup automation)
Line 17:
=={{header|Julia}}==
{{trans|Perl}}
<langsyntaxhighlight lang="julia">shaved = [1, 5, 30, 60, 300, 1800, 3600, 21600, 86400]
columns = [" 1 Second", " 5 Seconds", "30 Seconds", " 1 Minute", " 5 Minutes", "30 Minutes", " 1 Hour", " 6 Hours", " 1 Day"]
diy, minute, hour, day, week = 365.25, 60, 60 * 60, 60 * 60 * 24, 60 * 60 * 24 * 7
Line 38:
println(row)
end
</langsyntaxhighlight>{{out}}
<pre>
How Often You Do the Task
Line 57:
 
=={{header|Perl}}==
<langsyntaxhighlight lang="perl">use strict;
use warnings;
use feature <say switch>;
Line 92:
}
say $row;
}</langsyntaxhighlight>
{{out}}
<pre> How Often You Do the Task
Line 109:
 
=={{header|Phix}}==
<!--<langsyntaxhighlight Phixlang="phix">(phixonline)-->
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">SEC</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">1</span><span style="color: #0000FF;">,</span>
Line 148:
<span style="color: #7060A8;">printf</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"%s\n"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">line</span><span style="color: #0000FF;">)</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<!--</langsyntaxhighlight>-->
{{out}}
One outlier here is 1hr 5/day ==> 3 years vs original 10 months: as per notes above for 5/8ths the cutoff is indeed 3 years.<br>
Line 167:
=={{header|Raku}}==
{{trans|Wren}}
<syntaxhighlight lang="raku" perl6line># 20220207 Raku programming solution
 
my \shaved = [1, 5, 30, 60, 300, 1800, 3600, 21600, 86400]; # time shaved off in seconds
Line 203:
}
print "\n"
}</langsyntaxhighlight>
{{out}}
<pre>
Line 222:
=={{header|Vlang}}==
{{trans|Wren}}
<langsyntaxhighlight lang="vlang">import math
const (
shaved = [1, 5, 30, 60, 300, 1800, 3600, 21600, 86400] // time shaved off in seconds
Line 274:
println('')
}
}</langsyntaxhighlight>
 
{{out}}
Line 295:
{{libheader|Wren-fmt}}
This is quite close to the original table but no cigar.
<langsyntaxhighlight lang="ecmascript">import "./fmt" for Fmt
 
var shaved = [1, 5, 30, 60, 300, 1800, 3600, 21600, 86400] // time shaved off in seconds
Line 341:
}
System.print()
}</langsyntaxhighlight>
 
{{out}}
Line 361:
=={{header|Yabasic}}==
{{trans|Phix}}
<langsyntaxhighlight Yabasiclang="yabasic">// Rosetta Code problem: http://rosettacode.org/wiki/Worthwhile_task_shaving
// by Galileo, 02/2022
 
Line 402:
next
print line$
next</langsyntaxhighlight>
{{out}}
<pre> 50/day 5/day daily weekly monthly yearly
10,327

edits