Re: Writing side of square

2008-05-05 Thread Jerald Sheets
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 bel

RE: Writing side of square

2008-05-05 Thread Thomas Bätzler
Rodrigo Tavares <[EMAIL PROTECTED]> asked: > I need create a square using a single number, but I don't > know how to create the sides. #!/usr/bin/perl -w use strict; for( my $n = 1 ; $n <= 10; $n++ ){ print "\nn = $n\n\n"; if( $n == 1 ){ print "*\n"; } else { print '*'x$n . "\n"

Re: Writing side of square

2008-05-05 Thread Rob Dixon
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 = ); > > my @array = (); > > $cont

Re: Writing side of square

2008-05-05 Thread Stephen Kratzer
On Monday 05 May 2008 09:22:51 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 = ); > > my @

Re: Writing side of square

2008-05-05 Thread Chas. Owens
On Mon, May 5, 2008 at 11:18 AM, Stephen Kratzer <[EMAIL PROTECTED]> wrote: snip > for (1..$n) { > if ($_ == 1 || $_ == $n) { > print "*" x $n, "\n"; > } > else { > > print "*", " " x ($n - 2), "*\n"; > } > } snip Its time to play T