3 ms·
I was wondering if it got harder or if it's just random: function generateColors(difficulty, blacklist) { ... let sample = Math.floor(Math.
by lucb1e 2y ago
I was wondering if it got harder or if it's just random:
function generateColors(difficulty, blacklist) {
...
let sample = Math.floor(Math.min(Math.max(0, 1-Math.pow(1-difficulty, 1.5)), .99)*5);
let distance = (5 - sample)/5;
...
}
function setupRound(blacklist) {
...
const data = generateColors(currentRound/totalRounds, blacklist);
...
}
Plotting that first magic: https://lucb1e.com/randomprojects/js/testformula.htm#%24%28%27formula%27%29.value%3D%27Math.floor%28Math.min%28Math.max%280%2C%201-Math.pow%281-difficulty%2C%201.5%29%29%2C%20.99%29*5%29%27%3B%24%28%27vars%27%29.value%3D%27difficulty%3D0.0-1.0i0.05%27%3B https://lucb1e.com/randomprojects/js/testformula.htm#%24%28%...
round# difference
0-- 2 5
3-- 5 4
6-- 9 3
10--13 2
14--20 1
The "blacklist" parameter prevents that you get the same challenge twice. Note also that it submits every answer to the server (fine imo, but I think it would be even nicer if this was mentioned on the page)
- tennysont 2y agoI appreciate https://lucb1e.com/randomprojects/js/testformula.html https://lucb1e.com/randomprojects/js/testformula.html, it's a cool idea!
- lucb1e 2y agoHappy to hear, though note the file is without l (lowercase L) in the end (I guess autocorrupt is to blame here?). Fun fact: if you remove the filename, it'll show you all the crap in that directory, listing this file as being last modified in 2015-09-27. If past performance is an indicator, it should be stable to use for the next ten years as well :D
- readingnews 2y agoThanks for posting, I thought the same thing... my (useless data point of one) results showed 100% accuracy except the last four, which I thought "wow, I am just guessing now, can literally not see a difference".