Thread for loop (10 answers)
Opened by nano at 2015-04-03 23:46

lichtkind
 2015-04-04 16:12
#180584 #180584
User since
2004-03-22
5697 Artikel
ModeratorIn + EditorIn
[Homepage]
user image
und nun perl 6 :)

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
use v6;

say "please enter two odd numbers";
my $odd1 = prompt "enter first odd number: ";
my $odd2 = prompt "enter second odd number: ";

exit unless $odd1 % 2 and $odd2 % 2;
my $min = min $odd1, $odd2;

say "numbers: ", ($min, $min+2 ... (max $odd1, $odd2));

Last edited: 2015-04-04 17:51:42 +0200 (CEST)
Wiki:Tutorien in der Wiki, mein zeug:
kephra, baumhaus, garten, gezwitscher

Es beginnt immer mit einer Entscheidung.

View full thread for loop