Blame | Last modification | View Log | RSS feed
r_=$scramble
!if $job=up
!bound k between integer 0 and $nx-1 default 0
!for i=1 to $ny
j_=$[$nx*($i%$ny)+$k+1]
s_=!item $j_ of $scramble
r_=!replace item number $[($i-1)*$nx+$k+1] by $s_ in $r_
!next i
!goto end
!endif
!if $job=down
!bound k between integer 0 and $nx-1 default 0
!for i=1 to $ny
j_=$[$nx*(($i-2+$ny)%$ny)+$k+1]
s_=!item $j_ of $scramble
r_=!replace item number $[($i-1)*$nx+$k+1] by $s_ in $r_
!next i
!goto end
!endif
!if $job=left
!bound k between integer 0 and $ny-1 default 0
a_=$[$k*$nx]
!for i=1 to $nx
j_=$[$i%$nx+$a_+1]
s_=!item $j_ of $scramble
r_=!replace item number $i+$a_ by $s_ in $r_
!next i
!goto end
!endif
!if $job=right
!bound k between integer 0 and $ny-1 default 0
a_=$[$k*$nx]
!for i=1 to $nx
j_=$[($i-2+$nx)%$nx+$a_+1]
s_=!item $j_ of $scramble
r_=!replace item number $i+$a_ by $s_ in $r_
!next i
!goto end
!endif
:end
scramble=!nospace $r_