fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 194: Circular shift of a two-dimensional array
Idiom # 194: Circular shift of a two-dimensional array
See
programming-idioms.org
:
Code
l0 := a.length0 l1 := a.length1 b := array2 l0 l1 (i,j -> a[i, (j+n) % l1])
What are effects?
Running Example
ex194 is a := array2 5 5 i,j->i*10+j n := 2 l0 := a.length0 l1 := a.length1 b := array2 l0 l1 (i,j -> a[i, (j+n) % l1]) say "a is $a" say "b is $b"
What are effects?
last changed: 2024-07-01
next: Idiom # 195: Pass a two-dimensional array