2 ms·
This is a fantastic article! I built something similar a few years ago, except I couldn't rely on a centralized server. So I had to come up with a P2P/decentral
by marknadal 9y ago
This is a fantastic article! I built something similar a few years ago, except I couldn't rely on a centralized server. So I had to come up with a P2P/decentralized variant of it.
There is a test page up for it, so you can test it out in practice across multiple devices to see how precise (not accurate) it is: https://gunjs.herokuapp.com/game/nts.html https://gunjs.herokuapp.com/game/nts.html
Turns out the math/algorithm isn't too hard! Less than 50LOC for full implementation: https://github.com/amark/gun/blob/master/nts.js https://github.com/amark/gun/blob/master/nts.js
I recommend you have fun and challenge yourself to solve it first before looking at the code! It made me really understand General Relativity spacetime so much more, it clicked.