Re: self centering random walk within defined range

2009-02-28 Thread Chas. Owens
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; # 12345678901 # * # 5/11 chance of

Re: self centering random walk within defined range

2009-02-28 Thread Chas. Owens
On Sat, Feb 28, 2009 at 12:22, wrote: > Rob Dixon said : >> r...@goto10.org wrote: >> > hi, >> > >> > i am finding something couter intuative about randomness and search for a >> > solution. >> > >> > i have a bit of code that randomly selects a number from an array and then >> > adds >> > it to

Re: self centering random walk within defined range

2009-02-28 Thread rob
Rob Dixon said : > r...@goto10.org wrote: > > hi, > > > > i am finding something couter intuative about randomness and search for a > > solution. > > > > i have a bit of code that randomly selects a number from an array and then > > adds > > it to the previous number. I have two positive numb

Re: self centering random walk within defined range

2009-02-28 Thread Rob Dixon
r...@goto10.org wrote: > hi, > > i am finding something couter intuative about randomness and search for a > solution. > > i have a bit of code that randomly selects a number from an array and then > adds > it to the previous number. I have two positive numbers and their negitives > qw(1 2

self centering random walk within defined range

2009-02-28 Thread rob
hi, i am finding something couter intuative about randomness and search for a solution. i have a bit of code that randomly selects a number from an array and then adds it to the previous number. I have two positive numbers and their negitives qw(1 2 -1 -2) i expected the below code to hover

Re: picking largest key by value..

2009-02-28 Thread Chas. Owens
On Sat, Feb 28, 2009 at 07:13, Chas. Owens wrote: snip > Depends on your version of Perl.  Perl prior to 5.8.1 the order of a > set of keys in a hash was always the same (but unordered). snip This should read: Perl prior to 5.8.1 the order of a set of keys in a hash was always the same (