Generators.observe(change => {
const buttons = gp => gp.buttons.map(b => (b.pressed ? 'O' : '.')).join('');
const axeSign = a => '-.+'[Math.sign(Math.round(a)) + 1];
const axes = gp => gp.axes.map(axeSign).join('');
const info = gp => `Gamepad #${gp.index}: ${axes(gp)} ${buttons(gp)}`;
const formatGamepads = gamepads => gamepads.map(info).join('\n');
setInterval(() => change(formatGamepads(getGamepads())), 100);
})