Re: Printing asterisks in screen

2007-08-25 Thread John W. Krahn
Rodrigo Tavares wrote: Hello, Hello, I bought a book about Programming Perl, there is a exercise : 1) Enter with a number and print asterisks (1..30) ex: if you type six have go to screen: ** See the below code : if (($num1 >= 1 && $num1 <= 30) { for (my $i=1 ; $i < 30 ; $i++)

Re: Printing asterisks in screen

2007-08-25 Thread Gunnar Hjalmarsson
Rodrigo Tavares wrote: 1) Enter with a number and print asterisks (1..30) ex: if you type six have go to screen: ** if ( $num >= 1 and $num <= 30 ) { print '*' x $num, "\n"; } if (($num1 >= 1 && $num1 <= 30) { for (my $i=1 ; $i < 30 ; $i++) { while ($n

Re: Printing asterisks in screen

2007-08-25 Thread Ken Foskey
On Sat, 2007-08-25 at 16:36 -0300, Rodrigo Tavares wrote: > if (($num1 >= 1 && $num1 <= 30) > { > for (my $i=1 ; $i < 30 ; $i++) > { > while ($num1 == $i) > { > print "*"; > } > } > } Think in terms of values: Use 6 instead of $num1 and thin