Zig-zag matrix: Difference between revisions
Content added Content deleted
(Added Quackery.) |
(→{{header|Quackery}}: simplified) |
||
Line 5,216: | Line 5,216: | ||
{{trans|Python:_By_sorting_indices}} |
{{trans|Python:_By_sorting_indices}} |
||
<lang Quackery> [ |
<lang Quackery> [ ]'[ tuck do dip do ] is with2 ( x x --> x x ) |
||
[] swap |
|||
dup |
[ dup temp put |
||
[] swap |
|||
dup * times [ i^ join ] |
|||
⚫ | |||
1 & if negate swap |
|||
[ with2 |
|||
[ temp share /mod |
|||
tuck + 1 & |
|||
⚫ | |||
if negate ] |
|||
> ] |
|||
sortwith |
|||
[ with2 |
|||
[ |
[ temp share /mod + ] |
||
> ] |
|||
dup witheach |
|||
[ 0 peek swap 0 peek > ] |
|||
[ |
[ i^ unrot poke ] |
||
[] swap |
|||
temp share times |
|||
[ |
[ temp share split |
||
⚫ | |||
temp share times |
|||
drop |
|||
[ temp share split |
|||
⚫ | |||
⚫ | |||
⚫ | |||
10 zigzag |
10 zigzag |