❔ I'm not sure what to use here... A Multidimensional Array? A hash table? A Matrix?

This is going to be a bit of a winded question. I'm currently trying to design an outcome system that abuses numbers in a 3D space. I have a 3D example that's been flattened out to show what I wish to create. These numbers will be separated into 6 individual groups each containing 9 different slots who contain a possible value of 0-9. The interchangeable values can be effected by a user's input at all times. Now, I'm not 100% sure what I should use here. All I can say is that the reason for why this is a 3 dimensional piece rather than using only 3 rows and 3 columns is because of how the numbers can be changed and what each face (such as a row's value or a face's pattern) will represent once set. While the user's input can also change a single slot's value, the user can also make drastic changes much like a Rubik's cube. For example: If a user does "X", the result of Y would be: -Top Face (Or all the rows and columns belonging to the top face, including the rows belonging to front, back, left and right) have their values rotate clockwise.
2 Replies
Anton
Anton2y ago
store it in the format that's easier for most operations but also write conversion functions to make implementing the algorithms that are harder in that view easier aka if you're storing it as a rubicks cube, make available access to sides by index (returns 3x3 array) if storing as 6 arrays, make indexing with 3d coordinates available
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server