Rosetta Code/Run examples: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (→{{header|Perl 6}}: Add Perl6 example) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Add some example output) |
||
Line 386: | Line 386: | ||
sub load-resources { () } # load resources for finer control |
sub load-resources { () } # load resources for finer control |
||
</lang> |
</lang> |
||
{{out}} with command line: '''perl6 RC-run.p6 "Determine if a string is numeric"''' |
|||
<pre>Retreiving tasks |
|||
1 Determine if a string is numeric |
|||
Getting code from: http://rosettacode.org/wiki/Determine_if_a_string_is_numeric#Perl_6 |
|||
Testing Determine_if_a_string_is_numeric |
|||
Command line: perl6 Determine_if_a_string_is_numeric.p6 |
|||
Coerce Don't coerce |
|||
String whitespace whitespace |
|||
<1> True True |
|||
<1.2> True True |
|||
<1.2.3> False False |
|||
<-6> True True |
|||
<1/2> True True |
|||
<12e> False False |
|||
<B17> False False |
|||
<1.3e+12> True True |
|||
<1.3e12> True True |
|||
<-2.6e-3> True True |
|||
<zero> False False |
|||
<0x> False False |
|||
<0xA10> True True |
|||
<0b1001> True True |
|||
<0o16> True True |
|||
<0o18> False False |
|||
<2+5i> True True |
|||
<1 1 1> False False |
|||
<> True False |
|||
< > True False |
|||
Done Determine_if_a_string_is_numeric |
|||
===============================================================================</pre> |
|||
Or, if the full %resources hash is loaded it will autmatically feed input parameters to tasks that require them:<br> |
|||
'''perl6 RC-run.p6 Lucky_and_even_lucky_numbers''' |
|||
<pre>Retreiving tasks |
|||
1 Lucky_and_even_lucky_numbers |
|||
Getting code from: http://rosettacode.org/wiki/Lucky_and_even_lucky_numbers#Perl_6 |
|||
Testing Lucky_and_even_lucky_numbers |
|||
Command line: perl6 Lucky_and_even_lucky_numbers.p6 20 , lucky |
|||
79 |
|||
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) |
|||
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) |
|||
Command line: perl6 Lucky_and_even_lucky_numbers.p6 6000 -6100 |
|||
(6009 6019 6031 6049 6055 6061 6079 6093) |
|||
Command line: perl6 Lucky_and_even_lucky_numbers.p6 6000 -6100 evenlucky |
|||
(6018 6020 6022 6026 6036 6038 6050 6058 6074 6090 6092) |
|||
Done Lucky_and_even_lucky_numbers |
|||
===============================================================================</pre> |
|||
=={{header|Run BASIC}}== |
=={{header|Run BASIC}}== |