GHMON has asked for the wisdom of the Perl Monks concerning the following question:
Hi
i want to fill %positon by range of keys and values ,like this !!!!! that make keys in range of @ks and any keys have 2 values in range of $xpoints and $ypoints !!!!!
use warnings ; use strict ; print 'Last X Point' , "\n" ; my $xpoints = chomp (<STDIN>) ; print 'Last Y Point' , "\n" ; my $ypoints = chomp (<STDIN>) ; my @xp = ("0" .. $xpoints) ; my @yp = ("0" .. $ypoints) ; my @ks = ("1" .. ((xpoints*$ypoints))) ; my %position = ( 'a' => [0,0] , 'b' => [1,0] , 'c' => [2,0] , 'd' => [3,0] , 'e' => [0,1] , 'f' => [1,1] , 'g' => [2,1] , 'h' => [3,1] , 'i' => [0,2] , 'k' => [1,2] , 'l' => [2,2] , 'm' => [3,2] , 'n' => [0,3] , 'o' => [1,3] , 'p' => [2,3] , 'q' => [3,3] , ) ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Make a hash by a range of keys and values
by choroba (Cardinal) on Oct 31, 2018 at 21:37 UTC | |
by GHMON (Novice) on Nov 01, 2018 at 13:31 UTC | |
|
Re: Make a hash by a range of keys and values
by poj (Abbot) on Oct 31, 2018 at 21:26 UTC | |
by GHMON (Novice) on Nov 01, 2018 at 13:32 UTC | |
|
Re: Make a hash by a range of keys and values
by localshop (Monk) on Oct 31, 2018 at 21:37 UTC | |
|
Re: Make a hash by a range of keys and values
by johngg (Canon) on Nov 01, 2018 at 00:27 UTC | |
|
Re: Make a hash by a range of keys and values
by roboticus (Chancellor) on Oct 31, 2018 at 21:28 UTC |