Range consolidation: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: simplified code.) |
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
||
Line 914: | Line 914: | ||
[4, 3], [2, 1], [-1, -2], [3.9, 10] => -2..-1 1..2 3..10 |
[4, 3], [2, 1], [-1, -2], [3.9, 10] => -2..-1 1..2 3..10 |
||
[1, 3], [-6, -1], [-4, -5], [8, 2], [-6, -6] => -6..-1 1..8</pre> |
[1, 3], [-6, -1], [-4, -5], [8, 2], [-6, -6] => -6..-1 1..8</pre> |
||
⚫ | |||
⚫ | |||
⚫ | In Perl 6, a Range is a first class object with its own specialized notation. Perl 6 Ranges allow for exclusion of the boundary numbers. This example doesn't since it isn't a requirement in this task. Much of the logic is lifted from the [[Set_of_real_numbers#Perl_6|Set_of_real_numbers]] task with simplified logic for the much simpler requirements. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
Line 1,164: | Line 1,123: | ||
((4 3) (2 1) (-1 -2) (3.9 10)) => ((-2 -1) (1 2) (3 10)) |
((4 3) (2 1) (-1 -2) (3.9 10)) => ((-2 -1) (1 2) (3 10)) |
||
((1 3) (-6 -1) (-4 -5) (8 2) (-6 -6)) => ((-6 -1) (1 8)) |
((1 3) (-6 -1) (-4 -5) (8 2) (-6 -6)) => ((-6 -1) (1 8)) |
||
⚫ | |||
⚫ | |||
(formerly Perl 6) |
|||
⚫ | |||
⚫ | In Perl 6, a Range is a first class object with its own specialized notation. Perl 6 Ranges allow for exclusion of the boundary numbers. This example doesn't since it isn't a requirement in this task. Much of the logic is lifted from the [[Set_of_real_numbers#Perl_6|Set_of_real_numbers]] task with simplified logic for the much simpler requirements. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</pre> |
</pre> |
||