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
#2
Other than 3D models, you could do Row, column, page of a book?

Letter$(row, col, page) = a letter.
b = b + ...
Reply
#3
For a simple "database". Table, row, column
Ask me about Windows API and maybe some Linux stuff
Reply
#4
Three dimensions:
  1. front, mid, back seats
  2. driver or passenger's side
  3. which SUV.
Reply
#5
First, Middle, Last names in a 3D name database.
Reply
#6
Big Grin 
I see it and it reminds me of Charles Babbage. Misunderstood at the time, today its star shines bright and clear in the sky of internet technology.  Rolleyes

The day will come when the Third Dimensional Array will be named in the same breath as a Babbage or a Zuse.  Cool
Reply
#7
Quote:Structure and representation of a three-dimensional array. What could one do with it? For example: day, month, total sales 
...

Good! How many items can be in the group of ternary set?
is it more mathematical question or more philosophical question?

hh: mm: ss  (time)

X:Y:Z  (3D space)

dd:mm:yyyy  (date)

ternar oxide/ salt/ acid   (chemical compound)

0 :1: 2  (ternary number system)

thesis antithesis synthesis  (Hegel)

quiet motion acceleration (Physics)

good   bad  man  (Ethics)

compiled  interpreted  bytecode (Informatic science)

child adult old (time evolution of man)

input  output state (information science)

earnings   losses  balance (economic computation)

incoming,  outcoming, total (economy:balance)

debit, credit,  total  (double entry bookkeeping)

and so on...
Reply
#8
(01-03-2023, 07:56 PM)SMcNeill Wrote: First, Middle, Last names in a 3D name database.

Name, Date of birth, Sex in a friend database   in which Name is compound by First, Middle, Last names
Reply
#9
Well, I can't think of a practical application right now. Maybe something for mathematicians who can store three-dimensional functions in it. It would be impractical for a "normal" database. I would take two or three records that access each other. For example:

Code: (Select All)
Type employee
   firstName As String * 20
   lastName As String * 20
   birthday As As String * 10
EndType

Type function
   programmer As employee
   salary as employee
   . . .
EndType

The 3D array is a nice exercise, and I haven't found anywhere that shows a graphical representation of a 3D array.
Reply
#10
(01-04-2023, 10:12 PM)Kernelpanic Wrote: Well, I can't think of a practical application right now. Maybe something for mathematicians who can store three-dimensional functions in it. It would be impractical for a "normal" database. I would take two or three records that access each other. For example:

Code: (Select All)
Type employee
   firstName As String * 20
   lastName As String * 20
   birthday As As String * 10
EndType

Type function
   programmer As employee
   salary as employee
   . . .
EndType

The 3D array is a nice exercise, and I haven't found anywhere that shows a graphical representation of a 3D array.


[Image: E03494-F0-F637-4-CE6-B738-1-E35-BBD20-ADF.png]
Reply




Users browsing this thread: 7 Guest(s)