QBasic Tutorial 17 - 2 Dimensional Array - Matrix - QB64


Multi-Dimensional Arrays are several arrays that are combined into one. Some examples where a 2 dimensional array might be used would be a chess board, grid, and a deck of cards.

For this tutorial we will create a 2D (Matrix) array for a deck of cards.
In a deck of cards, there are 4 suits and 13 ranks per suit.

The suits are Diamonds, Spades, Hearts, Clubs
The ranks are 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace

We can create a 2D array from the array of suits and the array of ranks.

Code Download
QBT17.BAS 



QBasic / QB64 Links

QB64 is a free download at www.qb64.com

QB64 Wiki & Manual is found at qb64.com/wiki.html

QBasic 1.1 comes with OldDOS. A zip file of OldDOS can be found at www.pcxt-micro.com/download.html

QBasic 1.1 needs DOSBox to run on Windows Vista and greater, Mac, and Linux.
DosBox is a free download at www.dosbox.com

Free QB64/QBasic Code

QBasic.Net - www.qbasic.net

Pete's QBasic Site - www.petesqbsite.com/index.php

QB45 - qb45.org

Phatcode - games.phatcode.net