Walsh matrix: Difference between revisions
Content deleted Content added
mNo edit summary |
added RPL |
||
Line 1,261: | Line 1,261: | ||
| [[File:Walsh-matrix--order-5--sign-changes-sort-order--raku.svg|150px|thumb]] |
| [[File:Walsh-matrix--order-5--sign-changes-sort-order--raku.svg|150px|thumb]] |
||
|} |
|} |
||
=={{header|RPL}}== |
|||
« DUP SIZE DUP 1 GET |
|||
SWAP 2 * 0 CON ROT ROT → w k |
|||
« 0 3 '''FOR''' t |
|||
'''IF''' t 3 == '''THEN''' -1 'w' STO* '''END''' |
|||
1 k SQ '''FOR''' z |
|||
z DUP 1 - k / IP k * + |
|||
t 2 MOD LASTARG / IP <span style="color:grey">@ can be replaced by IDIV2 on HP-49s</span> |
|||
k * SWAP k SQ * 2 * + + |
|||
w z GET |
|||
PUT |
|||
'''NEXT NEXT''' |
|||
» » '<span style="color:blue">NEXTW</span>' STO |
|||
« [[1 1][1 -1]] |
|||
'''WHILE''' SWAP 1 - DUP '''REPEAT''' |
|||
SWAP <span style="color:blue">NEXTW</span> |
|||
'''END''' DROP |
|||
» '<span style="color:blue">WALSH</span>' STO |
|||
4 <span style="color:blue">WALSH</span> |
|||
{{out}} |
|||
<pre> |
|||
1: [[ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ] |
|||
[ 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ] |
|||
[ 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 ] |
|||
[ 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 ] |
|||
[ 1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 ] |
|||
[ 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 ] |
|||
[ 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 1 ] |
|||
[ 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 ] |
|||
[ 1 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 ] |
|||
[ 1 -1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 1 ] |
|||
[ 1 1 -1 -1 1 1 -1 -1 -1 -1 1 1 -1 -1 1 1 ] |
|||
[ 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 ] |
|||
[ 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 ] |
|||
[ 1 -1 1 -1 -1 1 -1 1 -1 1 -1 1 1 -1 1 -1 ] |
|||
[ 1 1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 1 -1 -1 ] |
|||
[ 1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 1 ]] |
|||
</pre> |
|||
=={{header|Wren}}== |
=={{header|Wren}}== |