Rosetta Code/Run examples: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl 6}}: Add some example output)
m (→‎{{header|Perl 6}}: Better newline spacing)
Line 371: Line 371:
my @cmd = %resource{$code}<cmd> ?? |%resource{$code}<cmd> !! "$exe $code.p6";
my @cmd = %resource{$code}<cmd> ?? |%resource{$code}<cmd> !! "$exe $code.p6";
for @cmd -> $cmd {
for @cmd -> $cmd {
say "Command line: $cmd\n";
say "\nCommand line: $cmd";
try EVAL(shell $cmd);
try EVAL(shell $cmd);
}
}
Line 393: Line 393:


Testing Determine_if_a_string_is_numeric
Testing Determine_if_a_string_is_numeric
Command line: perl6 Determine_if_a_string_is_numeric.p6


Command line: perl6 Determine_if_a_string_is_numeric.p6
Coerce Don't coerce
Coerce Don't coerce
String whitespace whitespace
String whitespace whitespace
Line 427: Line 427:


Testing Lucky_and_even_lucky_numbers
Testing Lucky_and_even_lucky_numbers

Command line: perl6 Lucky_and_even_lucky_numbers.p6 20 , lucky
Command line: perl6 Lucky_and_even_lucky_numbers.p6 20 , lucky



79
79

Command line: perl6 Lucky_and_even_lucky_numbers.p6 1 20
Command line: perl6 Lucky_and_even_lucky_numbers.p6 1 20


(1 3 7 9 13 15 21 25 31 33 37 43 49 51 63 67 69 73 75 79)


(1 3 7 9 13 15 21 25 31 33 37 43 49 51 63 67 69 73 75 79)
Command line: perl6 Lucky_and_even_lucky_numbers.p6 1 20 evenlucky
Command line: perl6 Lucky_and_even_lucky_numbers.p6 1 20 evenlucky



(2 4 6 10 12 18 20 22 26 34 36 42 44 50 52 54 58 68 70 76)
(2 4 6 10 12 18 20 22 26 34 36 42 44 50 52 54 58 68 70 76)

Command line: perl6 Lucky_and_even_lucky_numbers.p6 6000 -6100
Command line: perl6 Lucky_and_even_lucky_numbers.p6 6000 -6100



(6009 6019 6031 6049 6055 6061 6079 6093)
(6009 6019 6031 6049 6055 6061 6079 6093)
Command line: perl6 Lucky_and_even_lucky_numbers.p6 6000 -6100 evenlucky


Command line: perl6 Lucky_and_even_lucky_numbers.p6 6000 -6100 evenlucky


(6018 6020 6022 6026 6036 6038 6050 6058 6074 6090 6092)
(6018 6020 6022 6026 6036 6038 6050 6058 6074 6090 6092)