4 ms·
Back in like 1996 I tried to write a MUD using Visual Basic when I had no idea how classes and objects work, but I understood arrays and how to use "Redim Prese
by Sohcahtoa82 2y ago
Back in like 1996 I tried to write a MUD using Visual Basic when I had no idea how classes and objects work, but I understood arrays and how to use "Redim Preserve" to change the size of an array while keeping its contents. So any time something needed to make a reference to something else, I stored the index of where that thing was in another array. It made code EXTREMELY ugly.
No data structures, just lots of arrays. Instead of something like "player.health = 100", it was "playerHealth(playerIndex) = 100".
If I wanted to make a player hit a monster, it was like "monsterHealth(playerTarget(playerIndex)) -= playerStrength(playerIndex) + weaponDamage(playerWeapon(playerIndex))"
Awful and unmaintainable.
- flomo 2y agoA lot of production VB apps were written the same way. Array was the only data structure.