Three-dimensional array
#18
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)
Reply


Messages In This Thread
Three-dimensional array - by Kernelpanic - 01-03-2023, 06:39 PM
RE: Three-dimensional array - by bplus - 01-03-2023, 07:38 PM
RE: Three-dimensional array - by SpriggsySpriggs - 01-03-2023, 07:40 PM
RE: Three-dimensional array - by mnrvovrfc - 01-03-2023, 07:46 PM
RE: Three-dimensional array - by SMcNeill - 01-03-2023, 07:56 PM
RE: Three-dimensional array - by TempodiBasic - 01-03-2023, 11:13 PM
RE: Three-dimensional array - by Kernelpanic - 01-03-2023, 08:36 PM
RE: Three-dimensional array - by TempodiBasic - 01-03-2023, 11:07 PM
RE: Three-dimensional array - by Kernelpanic - 01-04-2023, 10:12 PM
RE: Three-dimensional array - by SMcNeill - 01-04-2023, 10:57 PM
RE: Three-dimensional array - by TerryRitchie - 01-04-2023, 11:41 PM
RE: Three-dimensional array - by Kernelpanic - 01-06-2023, 03:20 PM
RE: Three-dimensional array - by TempodiBasic - 01-05-2023, 09:07 PM
RE: Three-dimensional array - by mnrvovrfc - 01-05-2023, 10:07 PM
RE: Three-dimensional array - by TerryRitchie - 01-05-2023, 10:04 PM
RE: Three-dimensional array - by SpriggsySpriggs - 01-06-2023, 03:48 PM
RE: Three-dimensional array - by SMcNeill - 01-07-2023, 12:17 AM
RE: Three-dimensional array - by James D Jarvis - 01-07-2023, 04:53 AM
RE: Three-dimensional array - by mnrvovrfc - 01-07-2023, 06:41 AM
RE: Three-dimensional array - by TempodiBasic - 01-07-2023, 11:55 AM
RE: Three-dimensional array - by TempodiBasic - 01-08-2023, 05:39 PM



Users browsing this thread: 1 Guest(s)