1.4 - Matrices
Have you heard of The Matrix ? If you haven't watched it, you should.
Two-dimensional arrays of data are also known as a matrix. They can be written in several ways but most people think of them like a typical x-y plane of rows and columns.
Games, grids, and data science use matrices to control, manipulate, and calculate large amounts of data. Whenever you see a shape drawn on a computer, there is a good chance the data for that visualization is being held in a matrix.
A matrix is always listed as height first, then width. So a m x n matrix has height m and width n.
A path or maze from a start point to an end is another good example.
We can also store numbers based on place-value and search much faster this way.
Think about checkers, chess, minesweeper, connect-four, battleship...
Some important resources:
See your task in Replit for the assignment.
Aside: A 3-dimensional matrix can be used to store even more data, like depth. Your expensive graphics cards use tons of very large matrices and complex data manipulation to move and display things realistically. If you have an interest in game programming, you will take many classes on matrix manipulation in University. Thankfully, many toolkits already do this for us (like Unity and Unreal Engine).