develooper Front page | perl.beginners | Postings from May 2008

Re: Writing side of square

Thread Previous
From:
Jerald Sheets
Date:
May 5, 2008 06:38
Subject:
Re: Writing side of square

The perl module Graphics::Simple might be able to help you.

Found on CPAN.

--jms


On May 5, 2008, at 9:22 AM, Rodrigo Tavares wrote:

> Hello,
>
> I need create a square using a single number, but I don't know how  
> to create the sides.
>
> I have to create this:
>
> ****
> *  *
> *  *
> ****
>
> My code is below :
>
> print "Enter with number:";
> chomp ($number = <STDIN>);
>
> my @array = ();
>
> $cont = 0;
>
> while ($numero > $cont)
> {
> 	$array[$cont]="*";
> 	$cont++;
> }
>
> print @array;
> print "\n";
> print @array;
> print "\n";
>
> How I can to show the arrar like sides ?
>
> []'s
>
> Faria
>
>
>      Abra sua conta no Yahoo! Mail, o único sem limite de espaço  
> para armazenamento!
> http://br.mail.yahoo.com/
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>


Thread Previous


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About