FozzTexx on Nostr: Wow, I did it! function dist_calc(pt, idx) = concat([idx, sqrt(abs(pt[IDX_X] - ...
Wow, I did it!
function dist_calc(pt, idx) = concat([idx, sqrt(abs(pt[IDX_X] - pcb_mounts[idx][IDX_X]) ^ 2 + abs(pt[IDX_Y] - pcb_mounts[idx][IDX_Y]) ^ 2)], idx < len(pcb_mounts)-1 ? dist_calc(pt, idx+1) : []);
This is more difficult than programming in assembly. Makes me feel like I'm programming in some ancient obscure language used in the ‘70s.
function dist_calc(pt, idx) = concat([idx, sqrt(abs(pt[IDX_X] - pcb_mounts[idx][IDX_X]) ^ 2 + abs(pt[IDX_Y] - pcb_mounts[idx][IDX_Y]) ^ 2)], idx < len(pcb_mounts)-1 ? dist_calc(pt, idx+1) : []);
This is more difficult than programming in assembly. Makes me feel like I'm programming in some ancient obscure language used in the ‘70s.