Do it the same way you do it irl
After hours of work, I created the RUBIX CUBE SIMULATOR. TEN THOUSAND PIECES OF CODE.pls try it