Comma quibbling: Difference between revisions
Content deleted Content added
→{{header|Perl 6}}: removing double quotes |
→{{header|Perl 6}}: fixing case of two inputs |
||
Line 43: | Line 43: | ||
<lang perl6>sub comma-quibbling(@A) { |
<lang perl6>sub comma-quibbling(@A) { |
||
"\{$_\}" given |
"\{$_\}" given |
||
@A < 3 ?? @A.join(' |
@A < 3 ?? @A.join(' and ') !! |
||
@A[0..*-2].join(',') ~ ' and ' ~ @A[*-1] |
@A[0..*-2].join(',') ~ ' and ' ~ @A[*-1] |
||
} |
} |
||
Line 52: | Line 52: | ||
<pre>{} |
<pre>{} |
||
{ABC} |
{ABC} |
||
{ABC |
{ABC and DEF} |
||
{ABC,DEF,G and H}</pre> |
{ABC,DEF,G and H}</pre> |
||