Walsh matrix: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(2 intermediate revisions by one other user not shown)
Line 798:
 
'''Works with jaq, the Rust implementation of jq'''
 
This entry uses a non-recursive method for creating Walsh matrices, but the `kprod` definition
at [[Kronecker_product#jq]] could also be used as follows:
<syntaxhighlight lang="jq">
## Generate a Walsh matrix of size 2^$n for $n >= 1
def walshMatrixwalsh:
. as $n
| [[1, 1], [1, -1]] as $w2
| if $n < 2 then $w2 else kprod($w2; $n - 1 | walshMatrixwalsh) end;
</syntaxhighlight>
<syntaxhighlight lang="jq">
Line 1,500 ⟶ 1,501:
===Wren-cli===
Text mode version.
<syntaxhighlight lang="ecmascriptwren">import "./matrix" for Matrix
import "./fmt" for Fmt
 
Line 1,672 ⟶ 1,673:
{{libheader|Wren-polygon}}
Image mode version.
<syntaxhighlight lang="ecmascriptwren">import "dome" for Window
import "input" for Keyboard
import "graphics" for Canvas, Color
9,476

edits