Pong Wars: A battle between day and night, good and bad

(github.com)

46 points | by redbell 5 days ago ago

19 comments

  • harel 2 days ago ago

    This was posted a while back. I thought it was beautiful:

    https://yoavg.github.io/eternal/

  • zamadatix 2 days ago ago

    Lazy browser console hack to speed it up without locking the browser completely or rehosting:

      (()=>{for(let l=setInterval(()=>{},0);l;)clearInterval(l--);const c=new MessageChannel;c.port1.onmessage=_=>(draw(),c.port2.postMessage(0));c.port2.postMessage(0)})()
    
    It seems there are a lot of buggy positions which clear themselves given enough time. I managed to make it to 1,000,000 iterations without any permanent lockups (but some lasted a while)
  • Liftyee 2 days ago ago

    The neat thing about this is that it's self-balancing: if one side grows smaller, the ball bounces more often and increases how quickly it regains territory.

    • Contax 2 days ago ago

      Sorry for the tangential, but as a non-native English speaker, and still learning... this really caught my attention: "grows smaller". It looks like a kind of contradiction. Is it common to use that instead of, say, "shrink"?

      • bckr 2 days ago ago

        “Grows” is sometimes used as a synonym for “becomes” or “becomes more”.

        “Becomes smaller”

        • Contax 21 hours ago ago

          Thanks, TIL.

  • dash2 2 days ago ago

    Wasn't there a version of this with the yin and yang symbol posted recently? (Also there's a 2 year old hn post of this same thing)

  • bonyt a day ago ago

    This is fun!

    Mine got stuck in a cycle for a bit, but broke the cycle just after I stopped screen recording: https://i.moveything.com/c1d941787599.mp4

  • pmarreck 2 days ago ago

    Is there a version of this that works in a terminal and is 2-player?

    (Likely vibe-codeable...)

  • mhuffman 2 days ago ago

    I like it!

    Quick question, is the Day Pong a Master of Karate and friendship For Everyone?

  • hoofedear 2 days ago ago

    Would love if there were some screenshots in the readme! Just my two cents :)

    • hapidjus 2 days ago ago
    • zamadatix 2 days ago ago

      Is it that the video is .mov and not playing on your device or something?

      • hoofedear 2 days ago ago

        That’s my mistake, the link opened my GitHub app which doesn’t seem to show any video at all. Should’ve checked before commenting

      • pimlottc 2 days ago ago

        On my phone, the video just shows a play button, no title card. Mobile Safari

  • ge96 2 days ago ago

    What happens if the balls hit each other, singularity event?

  • lacoolj 2 days ago ago

    this appears to be the reverse of the yin yang version someone made like a month or so ago

    nice to see variety :)