∇ A show_cube State;View1;View2;Z1;Z2;F
[1] ⍝
[2] ⍝⍝ display the entire view, either in 2D or in 3D
[3] ⍝
[4] →A/V3D
[5] ⍝ 2-dimensional cube view...
[6] ⍝
[7] '' print_field 'w'
[8] Z1←2 12⍴⊂' ' print_field 'w' ◊ F←'' print_field 'w'
[9] Z2←Z1, State row_2D (face 1) 1 ◊ ∈Z2[1;],F ◊ ∈Z2[2;],F
[10] Z2←Z1, State row_2D (face 1) 2 ◊ ∈Z2[1;],F ◊ ∈Z2[2;],F
[11] Z2←Z1, State row_2D (face 1) 3 ◊ ∈Z2[1;],F ◊ ∈Z2[2;],F
[12] Z2← State row_2D (face 2) 1
[13] Z2←Z2, State row_2D (face 3) 1
[14] Z2←Z2, State row_2D (face 4) 1
[15] Z2←Z2, State row_2D (face 5) 1 ◊ ∈Z2[1;],F ◊ ∈Z2[2;],F
[16] Z2← State row_2D (face 2) 2
[17] Z2←Z2, State row_2D (face 3) 2
[18] Z2←Z2, State row_2D (face 4) 2
[19] Z2←Z2, State row_2D (face 5) 2 ◊ ∈Z2[1;],F ◊ ∈Z2[2;],F
[20] Z2← State row_2D (face 2) 3
[21] Z2←Z2, State row_2D (face 3) 3
[22] Z2←Z2, State row_2D (face 4) 3
[23] Z2←Z2, State row_2D (face 5) 3 ◊ ∈Z2[1;],F ◊ ∈Z2[2;],F
[24] Z2←Z1, State row_2D (face 6) 1 ◊ ∈Z2[1;],F ◊ ∈Z2[2;],F
[25] Z2←Z1, State row_2D (face 6) 2 ◊ ∈Z2[1;],F ◊ ∈Z2[2;],F
[26] Z2←Z1, State row_2D (face 6) 3 ◊ ∈Z2[1;],F ◊ ∈Z2[2;],F
[27] →0
[28] V3D: ⍝ 3-dimensional cube view
[29] '' print_field 'w' ◊ View←pattern 7 3 3
[30] Z1←State interpret_all View
[31] Z2←(⊖State) interpret_all View
[32] ⊣{ ⎕←' ',(⊃Z1[⍵]),(interpret_char 0),' ',(⊃Z2[⍵]), interpret_char 0 }¨⍳⍴Z2
∇
|