wealth = {
const numPeople = 100;
const wealth = new Float64Array(numPeople).fill(100);
while (true) {
for (let i = 0; i < numPeople; i++) {
if (wealth[i] > 0) {
const target = Math.floor(numPeople * Math.random());
wealth[target] += 1;
wealth[i] -= 1;
}
}
yield wealth;
}
}