output of permute() to list for sprintf

2009-02-04 Thread Rob Canning
hello, i am new to this list and very new to pearl. i have run into a problem i cant find a solution - i have searched the net for an answer but as i am so new to perl (and programming in general) perhaps i dont even know the right keywords... ok here it goes.. use Math::Combinatorics; my

Re: output of permute() to list for sprintf

2009-02-04 Thread Rob Canning
Dermot wrote: 2009/2/4 Rob Canning : hello, i am new to this list and very new to pearl. i have run into a problem i cant find a solution - i have searched the net for an answer but as i am so new to perl (and programming in general) perhaps i dont even know the right keywords... ok here

copy 3D array to 2D array

2009-02-10 Thread Rob Canning
hi, i am trying to copy a three dimensional array to a two dimentional one this: @AoA = ( [2, 3], [4, 5, 7], [0] ); to this @A = qw(2 3 4 5 7 0); i know the answer is staring at me in perldoc perldsc but i cant see it! thanks rob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org F

Invalid conversion in sprintf "%\"

2009-02-18 Thread Rob Canning
hi i have a sprintf which uses a scalar as its format: my $Bformat = "%1\$s16-> %2\$s16 %3\$s16 %4\$s16 %5\$s16 %6\$s16-> %7\$s16 %8\$s16" what i would like to do is generate a new format for the sprintf by doing permutations of 5 arrays like this: my @phraseA = qw( %1\$s16-> %2\$s16-> %3\$s16

Re: Invalid conversion in sprintf "%\"

2009-02-18 Thread Rob Canning
John W. Krahn said : > Rob Canning wrote: >> hi i have a sprintf which uses a scalar as its format: >> my $Bformat = "%1\$s16-> %2\$s16 %3\$s16 %4\$s16 %5\$s16 %6\$s16-> %7\$s16 >> %8\$s16" >> >> >> what i would like to do is generate a ne

Re: Invalid conversion in sprintf "%\"

2009-02-19 Thread Rob Canning
quot;, "%11\$s16 ", "%12\$s16"); my @phraseE = ("%13\$s16 ", "%14\$s16 ", "%15\$s16->"); my @phrasegroup = ([ @phraseA ], [ @phraseB ], [ @phraseC ], [ @phraseD ], [ @phraseE ]); my @phraseperm = map {...@$_} permute(@phrasegroup); #flatten permutatio

Re: self centering random walk within defined range

2009-03-01 Thread Rob Canning
Chas. Owens said : > On Sat, Feb 28, 2009 at 14:56, Chas. Owens wrote: > snip > > This seems close to what you want, but it needs work to make it take > > steps larger than 1: > snip > > Here is another version that takes steps larger than one: > > #!/usr/bin/perl > > use strict; > use warnings