refactor(generation): cultures start

This commit is contained in:
max 2022-07-24 23:32:59 +03:00
parent 1a57a8ac08
commit fe20f66b96
15 changed files with 621 additions and 581 deletions

View file

@ -49,7 +49,7 @@ window.BurgsAndStates = (function () {
let burgs = [0];
const rand = () => 0.5 + Math.random() * 0.5;
const score = new Int16Array(cells.s.map(s => s * rand())); // cell score for capitals placement
const score = new Int16Array(cells.s.map(s => s * Math.random())); // cell score for capitals placement
const sorted = cells.i.filter(i => score[i] > 0 && cells.culture[i]).sort((a, b) => score[b] - score[a]); // filtered and sorted array of indexes
if (sorted.length < count * 10) {