add replay functionality

This commit is contained in:
Zutatensuppe 2020-12-22 22:35:09 +01:00
parent 4158aa0854
commit 083fc0463c
13 changed files with 452 additions and 125 deletions

View file

@ -152,7 +152,19 @@ function coordByTileIdx(info, tileIdx) {
}
}
const hash = (str) => {
let hash = 0
for (let i = 0; i < str.length; i++) {
let chr = str.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
}
return hash;
}
export default {
hash,
uniqId,
randomInt,
choice,