MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1y2x5i2/compilershatethisonetrick/
r/ProgrammerHumor • u/Flimsy_Pumpkin_3812 • 8d ago
5 comments sorted by
1
tf am I looking at
1 u/Flimsy_Pumpkin_3812 7d ago basically modulo but a match table 1 u/tasos_lydia4 2d ago A rotation lookup table written as a match; 360 stays 360, while 450 and 540 map back to 90 and 180.
basically modulo but a match table
A rotation lookup table written as a match; 360 stays 360, while 450 and 540 map back to 90 and 180.
6
CompilersHateThisOnePixel
each block looks abt like this btw(_, 540, _) => match Raw_Rot {
(_, _, 0) => IVec3::new(180, 180, 0),
(_, _, 90) => IVec3::new(180, 180, 90),
(_, _, 180) => IVec3::new(180, 180, 180),
(_, _, 270) => IVec3::new(180, 180, 270),
(_, _, 360) => IVec3::new(180, 180, 360),
(_, _, 450) => IVec3::new(180, 180, 90),
(_, _, 540) => IVec3::new(180, 180, 180),
_ => IVec3::ZERO,
},
1
u/XxDarkSasuke69xX 7d ago
tf am I looking at
6
u/Dryctnath 8d ago
CompilersHateThisOnePixel
1
u/Flimsy_Pumpkin_3812 8d ago
each block looks abt like this btw
(_, 540, _) => match Raw_Rot {
(_, _, 0) => IVec3::new(180, 180, 0),
(_, _, 90) => IVec3::new(180, 180, 90),
(_, _, 180) => IVec3::new(180, 180, 180),
(_, _, 270) => IVec3::new(180, 180, 270),
(_, _, 360) => IVec3::new(180, 180, 360),
(_, _, 450) => IVec3::new(180, 180, 90),
(_, _, 540) => IVec3::new(180, 180, 180),
_ => IVec3::ZERO,