Jump to content

Chinese zodiac: Difference between revisions

→‎{{header|UNIX Shell}}: Make bash version work in ksh93+, too
(Added Fōrmulæ solution)
(→‎{{header|UNIX Shell}}: Make bash version work in ksh93+, too)
Line 3,700:
=={{header|UNIX Shell}}==
{{works with|Bash|4+}}
{{works with|Korn Shell|93+}}
Requires Bash 4 for associative arrays.
 
The required versions introduced support for associative arrays.
 
<pre>#!/usr/bin/env bash
Line 3,738 ⟶ 3,740:
BaseYear=4
 
function main() {
if (( !$# )); then
set -- $(date +%Y)
1,480

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.