01-07-2023, 04:53 AM
Code: (Select All)
'visual representation of a 3-dimensional array
Screen _NewImage(800, 600, 32)
_PrintMode _KeepBackground
Dim Shared cube$(9, 9, 9)
For z = 1 To 9
For y = 1 To 9
For x = 1 To 9
cube$(x, y, z) = _Trim$(Str$(x)) + _Trim$(Str$(y)) + _Trim$(Str$(z))
Next x
Next y
Next z
Do
For n = 1 To 12 Step 0.25
_Limit 6
Cls
For z = 1 To 9
Color _RGB32(z * 25 + 25, z * 25 + 25, z * 25 + 25)
For y = 1 To 9
For x = 1 To 9
_PrintString (x * (n * 4) + z * (n * 1.5), y * (n * 4) + z * n), cube$(x, y, z)
Next x
Next y
Next z
_Display
Next n
For n = 12 To 1 Step -0.25
_Limit 6
Cls
For z = 1 To 9
Color _RGB32(z * 25 + 25, z * 25 + 25, z * 25 + 25)
For y = 1 To 9
For x = 1 To 9
_PrintString (x * (n * 4) + z * (n * 1.5), y * (n * 4) + z * n), cube$(x, y, z)
Next x
Next y
Next z
_Display
Next n
Loop Until InKey$ = Chr$(27)