Timeline for Generate a grid of sums
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 10, 2018 at 13:18 | history | edited | mazzy | CC BY-SA 4.0 |
one pipe!
|
Aug 10, 2018 at 13:13 | comment | added | AdmBorkBork |
It doesn't work if you don't place parens around the assignment. With ($a=(,1*8+0,1*3)*3+,1*7|%{$_*(1+(Random 9))}) , $a is fully populated before the next pipeline instance. It should work (at least, it does for me).
|
|
Aug 10, 2018 at 13:10 | comment | added | mazzy |
No. It doesn't work. The array must be fully populated before $a[$i+$_] . So here are two steps. I had several attempts to encapsulate in one pipe. :)
|
|
Aug 10, 2018 at 12:50 | comment | added | AdmBorkBork |
You can get rid of a byte (a newline) by encapsulating your $a assignment in parens and moving the next line up to make one big line -- ($a=(,1*8+0,1*3)*3+,1*7|%{$_*(1+(Random 9))})|?{++$i;!$_}|%{6..8+1|%{$_,-$_}|%{$a[$i]+=$a[$i+$_]}}
|
|
Aug 9, 2018 at 13:13 | history | answered | mazzy | CC BY-SA 4.0 |