# Create a piddle of any dimensions with every element a random integer between MAX and MIN

(Difference between revisions)
 Revision as of 17:52, 26 June 2010 (view source)Punkish (Talk | contribs)← Older edit Revision as of 17:53, 26 June 2010 (view source)Punkish (Talk | contribs) Newer edit → Line 1: Line 1: perldl> \$a = (( (zeroes( [, ..] ))->random * ( - + 1 )) + )->floor perldl> \$a = (( (zeroes( [, ..] ))->random * ( - + 1 )) + )->floor - For example + For example, a 5, 5, 3 piddle with random integers between 1000 and 500 perldl> \$a = (( (zeroes( 5, 5, 3 ))->random * ( 1000 - 500 + 1 )) + 500 )->floor perldl> \$a = (( (zeroes( 5, 5, 3 ))->random * ( 1000 - 500 + 1 )) + 500 )->floor

## Revision as of 17:53, 26 June 2010

```   perldl> \$a = (( (zeroes( <dim> [, <dim> ..] ))->random * ( <max> - <min> + 1 )) + <min> )->floor
```

For example, a 5, 5, 3 piddle with random integers between 1000 and 500

```   perldl> \$a = (( (zeroes( 5, 5, 3 ))->random * ( 1000 - 500 + 1 )) + 500 )->floor
perldl> p \$a
perldl> p \$a
[
[
[ 759  780  741  581  828]
[1000  521  826  706  904]
[ 583  972  852  812  987]
[ 680  545  512  620  716]
[ 588  737  659  641  919]
]
[
[664 535 829 972 524]
[970 728 859 775 849]
[783 511 909 737 952]
[746 602 817 625 824]
[557 702 735 529 934]
]
[
[839 814 908 984 590]
[518 761 661 877 523]
[904 728 810 528 820]
[530 576 850 639 941]
[831 874 662 965 601]
]
]
```