// game.startTime = tock();
// }
// advance(game, game.todo, game.doing)
// break;
// case "o": // Another ka-ching! Hence another cycle time.
// // n can be incremented by advance(), so n here is the current number of ka-chings
// let n = game.kaching.hello.length;
// if (advance(game, game.doing, game.kaching)) {
// game.leadtimes.push(
// {
// hello: elapsed(game),
// // strict FIFO, even when balls restart
// leadtime: game.kaching.hello[n] - game.doing.hello[n]
// }
// );
// let l = game.leadtimes.map(k => k.leadtime); //. List of all leadtimes in this game.
// game.leadtime = +d3.mean(l).toFixed(0);
// if (l.length > 1) game.deviation = +d3.deviation(l).toFixed(0); // d3.deviation only meaningful with >1
// game.throughput = game ? game.kaching.hello.length / (game.playTime) : 0;
// };
// if (game.leadtimes.length > 0 && game.leadtimes.slice(-1)[0].leadtime > bag.maxLeadTime)
// bag.maxLeadTime = game.leadtimes.slice(-1)[0].leadtime;
// break;
// case "ArrowRight":
// mutable gameIndex = switchGame(mutable gameIndex, bag.game.length - 1, +1);
// // game = bag.game[mutable gameIndex];
// console.log(game);
// break;
// case "ArrowLeft":
// mutable gameIndex = switchGame(mutable gameIndex, bag.game.length - 1, -1);
// break;
// default:
// break;
// }
// function advance(game, from, to) {
// // Only advance an item when there is something to advance.
// let validMove = game && from.wip > 0 && game.transactions < 2 * toDo;
// if (validMove) {
// from.wip--;
// to.wip++;
// game.transactions++;
// game.playTime = tock() - game.startTime;
// game.finishTime = tock();
// let z = Math.ceil((tock() - mutable startTime) / 1000);
// if (z > mutable maxPlayTime) mutable maxPlayTime = z;
// to.hello.push(elapsed(game));
// }
// return validMove;
// }
// function switchGame(i, m, d) {
// let z = i + d;
// if (z > m) z = 0;
// if (z < 0) z = m;
// return z;
// }
// }
// }