4 ms·
Your page is not only awesome in creating my Catan clone, but also very useful when communicating on it with others. You have set the gold standard or the defac
by sharpercoder 8y ago
Your page is not only awesome in creating my Catan clone, but also very useful when communicating on it with others. You have set the gold standard or the defacto standard.
If you're interested in my implementation:
https://github.com/generateui/jsettlers-web/blob/master/src/coord.js https://github.com/generateui/jsettlers-web/blob/master/src/...
https://github.com/generateui/jsettlers-web/blob/master/src/node.js https://github.com/generateui/jsettlers-web/blob/master/src/...
https://github.com/generateui/jsettlers-web/blob/master/src/edge.js https://github.com/generateui/jsettlers-web/blob/master/src/...
https://github.com/generateui/jsettlers-web/blob/master/src/hex.js https://github.com/generateui/jsettlers-web/blob/master/src/...
A hex has a coord. A coord has 6 nodes and 6 edges. An Edge can be created from 2 coords or 2 nodes. A node can be created from 3 edges or 3 coords.
The implementation is immutable and memoized.