Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Show HN: Play rock paper and scissors against a untrained neural network. Parent comment
const times = 1000;
function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
async function run() { for (let i = 0; i < times; i++) { await sleep(10); play(Math.floor(Math.random()*3)); } }
run();
for(i=0; i<100; i++) { play(Math.floor(Math.random()*3)) }
Right in the JavaScript console.
const times = 1000;
function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
async function run() { for (let i = 0; i < times; i++) { await sleep(10); play(Math.floor(Math.random()*3)); } }
run();