6 ms·
Checkbox Olympics
- nickcw 4y agoAargh - no keyboard shortcuts allowed! That's me knocked out in the qualifying rounds of the checkbox olympics ;-)
- butz 4y agoAre you intentionally setting random tabindex values just to mess with keyboard users? I would like to suggest adding "Checkbox Paralympics" version, where keyboard users could compete too.
- crazywulf 4y agobest game! Time: 9.598 edit 1: 9.004 at my pixel, i am mobile gamer now! pog edit 2: 6.446 on phone !
- deleted 4y ago[deleted]
- acomjean 4y agoWhen done, don't forget to click the "back" arrow in the upper left corner. There is another checkbox event (hurdles...) In a weird way this reminds me of the old 80s "epyx" sports game which seemed to involve typeing keys as fast as you can. https://en.wikipedia.org/wiki/Summer_Games_(video_game) https://en.wikipedia.org/wiki/Summer_Games_(video_game)
- ptha 4y agoI remember playing a version of this on the (386?) PC. Bashing the various keys did not go down well with my dad. https://www.freegameempire.com/games/Summer-Games https://www.freegameempire.com/games/Summer-Games
- elchief 4y ago"Set" covers the 2nd checkbox. Fun
- klenwell 4y agoMy "speedrun": var simulateClick = function (elem) { // Create our event (with options) var evt = new MouseEvent('click', { bubbles: true, cancelable: true, view: window }); // If cancelled, don't dispatch our event var canceled = !elem.dispatchEvent(evt); }; var run = () => { var el = document.querySelector('input[type=checkbox]:not(:checked)') simulateClick(el) } setInterval(run, 100)
- chrismorgan 4y agoMy tool-assisted speedrun (0.001s): let setGo = document.querySelector(".setGo"); let observer = new MutationObserver(mutations => { if (setGo.classList.contains("going")) { for (const { target } of mutations) { if (target.checked == target.disabled) { target.click(); } } } }); observer.observe(setGo, {attributes: true}); document.querySelectorAll(".theSport input").forEach(checkbox => { observer.observe(checkbox, {attributes: true}); }); Explanation: instead of messing about with timers, it asks to be informed when any attribute changes (could use attributeFilter to only hear about "class" for setGo and "disabled" for checkboxes, but I didn’t bother). This is faster than can be acheived with setTimeout, setInterval or requestAnimationFrame, as timers are deliberately speed-capped. (Whereas mutation observers create microtasks, so we can go through this whole thing in one frame.) When the observer gets notified (in a microtask), it checks if we’re going (in order to avoid false starts), and then goes through the checkboxes it’s been told just changed, and checks if they’re enabled and unchecked, and clicks them. In practice, the first mutation will come in with mutation records for setGo and the first checkbox, which we’ll click, which will trigger an event (a task) from the page code which enables the second checkbox, which will trigger an immediate mutation notification (a microtask), &c. until it’s all done, without ever rendering a frame in the meantime.
- dhab 4y agoI went with a manual-mix approach: var boxes = document.querySelectorAll("#root > div > div.sportsWrapper > div.theSport > div:nth-child(2) > input[type=checkbox]") Then "start", wait for go signal while getting the code below ready on console. on go run the code: boxes.forEach(b => b.click()) Got: Time: 0.268
- texaslonghorn5 4y agoCool game! Doesn't really work for me on mobile because the second box is obscured by the SET button.
- forty 4y agoClick "ready" then wait for the "Go" to go green. Then you can start racing, and here at least, I was able to click through the Set light
- thih9 4y agoSimilar, a bit more challenging: https://checkboxrace.com/ https://checkboxrace.com/
- chrismorgan 4y agoMy TAS can be slightly adjusted to work with this one: let observer = new MutationObserver(mutations => { for (const { target } of mutations) { if (target.checked == target.disabled) { target.click(); } } }); document.querySelectorAll("[type=checkbox]").forEach(checkbox => { observer.observe(checkbox, {attributes: true}); }); Then click on the first checkbox and it’ll do all of the rest. Time varies a bit, best I’ve done in a couple of dozen attempts is 00:00:03.
- galoisgirl 4y agoWhat am I doing with my life...
- thih9 4y agoPerhaps finding timed checkbox challenges more fun than the other thing? Here are some more ideas for a break: - https://news.ycombinator.com/item?id=30517626 https://news.ycombinator.com/item?id=30517626 - https://news.ycombinator.com/item?id=31191152 https://news.ycombinator.com/item?id=31191152 - https://news.ycombinator.com/item?id=24320277 https://news.ycombinator.com/item?id=24320277
- brzezmac 4y agoLooks like a good place to workout before attempting to switch off notifications in some popular applications.
- layer8 4y agoCertain cookie opt-out dialogs are a good training ground as well.
- poiuyytrewq 4y agosetInterval(() => { if(document.querySelector('.going')) { document.querySelectorAll('.theSport input').forEach(box => { box.click(); }); }}, 10);
- LittlePeter 4y agor/mildlyinteresting, but would have been better if after the race you were shown your rank among other participants.
- deltree7 4y agoconsidering how people are already gaming/cheating on this, it's useless stats. Sure, you can write code to check for bots and the bots will write code to beat it...and so on
- LittlePeter 4y agoA deep learning model on the blockchain should be able to figure out cheaters from mouse movements and click intervals no? But yeah you are right.
- mywacaday 4y agoIn Chrome on a Note 10+ Set is covering the second checkbox and is uncheckable
- moralestapia 4y agoMore like Carpal Olympics, amirite?
- msoad 4y ago$('.readyButton').click(); setTimeout(()=> [...document.querySelectorAll('input[type="checkbox"]')].map(cb => cb.click()), 3000) This gives me 0.143 in Safari which is just a proof that DOM is freaking slow haha!
- alarmingfox 4y agoWow in Chrome 102.0.5005.115 (Official Build) (arm64) it gives me 3.273s which proves that point even more
- lauriswtf 4y agoHopefully you forgot to exclude 3sec timeout from that
- drudoo 4y agoI got 0.087 with firefox but subsequent tries are all in the 0.3-0.8 range.
- martini333 4y ago0.012 in Edge
- bduffany 4y agoI wonder how much of the time is spent in the onclick handler. Each of those clicks has to wait for the onclick handler before the next one executes, IIUC?
- eloox 4y agosetTimeout doesn't guarantee that it will execute exactly after 3000. (() => { const targ = $(".setGo"); const targ2 = $(".theSport > div:nth-child(2)"); const observer = new MutationObserver((mutations, observer) => { if (mutations[0]?.target?.classList.contains('going')) { targ2.childNodes.forEach(c => c.click()); } }); observer.observe(targ, { subtree: false, attributes: true }); $('.readyButton').click() })(); This gives me consistent Time: 0.001 in FF. "Time: not yet set" in Edge/Chrome.
- someweirdperson 4y agoOn my tablet the slightes movement of the pen causes firefox to select stuff instead of switching the checkbox. Causes extreme slow-down. Under normal circumstances I don't like websites to try to mess with selection, copynpaste, ... but in this case it would be both helpful and justified.
- usrusr 4y agoKind of like minesweeper, but without the strategy part? Because once a minesweeper addict has reached a certain base level of skill, the strategy part stops to be about where the mines are, it becomes all about reordering the click queue for speed. (don't ask me how I know)
- deleted 4y ago[deleted]
- conorcleary 4y ago15 and change on desktop Firefox
- sxv 4y ago13.533 on a mbp trackpad
- indifferentalex 4y agoSome of us have our stash of ~10 domain names for our side projects (that we renew year after year, with some embarrassment). Tim's got 90 linked from https://theuselessweb.com/ https://theuselessweb.com/ I wonder if he renews them on the cheap somehow, either way there are some really funny ones in there
- loudthing 4y agoIt would be nice if I got to see how I did against other players.
- bigtones 4y agoI got: 100 Meter Sprint 18.509 110 Meter Hurdles 18.85 Total Time: 37.359 with a mouse on desktop chrome.
- Benanov 4y agoThis basically told me I need a new / different trackball. The coefficient of static friction is too high in my current one to do this accurately - I need more force to start the ball rolling than I need to move to the next checkbox. I'm using a Sanwa Supply one now Looks like it might be a ploopy with BTS instead of their rollerbearings.
- dsr_ 4y agoHave you cleaned the ball and the bearings recently? I need to clean a Logitech M570 about every 2-3 weeks.
- demindiro 4y agoI decided to use Python instead of JS for this: import pyautogui as m from fastgrab import screenshot m.PAUSE = 0 while 1: x, y = m.position() r, g, b, _ = screenshot.Screenshot().capture((x, y, 1, 1))[0][0] if (r, g, b) in ((50, 205, 50), (127, 224, 127)): break m.moveRel(-35, 105) for _ in range(27): m.click() m.moveRel(23, 0) m.click() My record is 0.03 in FF EDIT: 0.02 in Chromium
- pickpuck 4y agoI think this demonstrates that: 1) the hit area of native checkboxes should be larger, and 2) fieldsets with checkboxes should come with a native "Toggle All" button
- april_22 4y agoit would be such a dream if the hit area for native checkboxes would be larger