in reply to Re: Chess Board Single Loop
in thread Chess Board Single Loop
the last line of the code I am stumped on. I want it to start a new line after five numbers. It works if the number range is smaller than 10 numbers, however if I expand past 10 numbers it keeps on trucking.#!/usr/bin/perl -w use strict; my $num1; my $num2; print "Enter in a whole number: "; chomp ($num1 = <STDIN>); print "Enter in another whole number: "; chomp ($num2 = <STDIN>); print "\n"; foreach ( $num1 .. $num2 ) { print "$_ "; print "\n" if ( $_ == ($num1 +4) ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Chess Board Single Loop
by kcott (Archbishop) on Oct 05, 2013 at 19:11 UTC | |
by xantithor (Novice) on Oct 05, 2013 at 19:28 UTC |