Three-dimensional array
#1
Structure and representation of a three-dimensional array. What could one do with it? For example: day, month, total sales . . . Nice!  Tongue
Oh yes, wrong inputs are not caught yet.

Ebene = level,  Zeile = row,  Spalte = column
Code: (Select All)
'Dreidimensionales Feld mit graphischer Darstellung - 3. Jan. 2023

$Console:Only
Option _Explicit

Option Base 1
Dim As Integer dreiDimFeld(3, 4, 4)

'"dm" legt die Dimension(Ebenen) fest. Hier dreimal Bloecke a 16
'dz ist Anzahl Zeilen, ds ist Anzahl Spalten
Dim As Integer dm, dz, ds, dFeld
Dim As Integer ebene, zeile, spalte

Locate 2, 2

'Der Ablauf ist: 1te Ebene -> Durchlauf Zeile * Spalte
'dann folgt die naechste Ebene usw. so viele Ebenen
'wie vorhanden sind
dFeld = 1
For dm = 1 To 3
  For dz = 1 To 4
    'Nach jedem sechszehner Block Absatz
    'fuer naechsten Block. Csrlin+1 statt 2 -> schraege Anzeige
    Locate CsrLin + 1, CsrLin + 1
    For ds = 1 To 4
      dreiDimFeld(dm, dz, ds) = dFeld
      Print Using "## "; dreiDimFeld(dm, dz, ds),
      dFeld = dFeld + 1
    Next
  Next
  Print: Locate , 2
Next

Locate CsrLin + 2, 2

Input "Zeige Wert in Ebene : ", ebene
Locate CsrLin + 0, 2
Input "Zeige Wert in Zeile : ", zeile
Locate CsrLin + 0, 2
Input "Und in Spalte       : ", spalte

Locate CsrLin + 1, 2
Print Using "Wert in Ebene: # Zeile: # Spalte: # ist: ##"; ebene, zeile, spalte, dreiDimFeld(ebene, zeile, spalte)

End

Straight and oblique version.
[Image: Dreidimensionales-Feld2023.jpg]
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: 4 Guest(s)