I saw this online somewhere and I just had to recreate it. This is my coding happy place.

You can see it live here: https://pong-wars.koenvangilst.nl/

Source code is just plain html, css and JavaScript, so you can see it in your browser.

Pong wars | Koen van Gilst

The eternal battle between day and night, good and bad. Written in JavaScript with some HTML & CSS in one index.html. Feel free to reuse the code and create your own version.

@vnglst Is there any stop condition, or does the war go on forever?

@vnglst I guess it never stops, right? One should be aware of that before starting to watch…

That said, it is really fascinating to watch. Especially after a while, when one player gets “trapped” in a small area. But as the area is small, it does not take long before it has enlarged it again, and joined with nearby exclaves. Etc.

@tml @vnglst as there is a finite number of states, it must enter into a loop at some point. Koen did you try to find loops?
@HydrePrever @tml @vnglst Fascinating indeed. I think you have to consider the transitions that depend on the position and direction of each ball too, and that sounds like many more possible combinations.
@HydrePrever @tml I did add little randomness to avoid that
@vnglst @tml cool! (or not, depending, short loops would be deceptive to watch but long loops would be cool) (also, nitpicking mode, you just multiply the number of possible states by the number of states of the PRNG so it's still finite 😁)