Most active commenters
  • (6)
  • hk__2(4)
  • francisduvivier(4)
  • jama211(3)
  • Insanity(3)
  • amelius(3)

Eternal Struggle

(yoavg.github.io)
671 points yurivish | 143 comments | | HN request time: 1.777s | source | bottom
1. jama211 ◴[] No.45086278[source]
I’m really keen to see what this looks like after significant time but I’m not going to leave it open on my phone for ages just to find out haha. Clever idea!
replies(2): >>45086627 #>>45086874 #
2. panarchy ◴[] No.45086333[source]
$10 on black
3. personalcompute ◴[] No.45086627[source]
Here is one sample taken after 5 minutes.

https://d6f9e5179057.s3.us-west-2.amazonaws.com/Screenshot%2...

replies(4): >>45086864 #>>45087000 #>>45088081 #>>45095737 #
4. SkipperCat ◴[] No.45086633[source]
An excellent piece of artwork! Really captures the meaning of Yin Yang, at least to me.
5. MarcelOlsz ◴[] No.45086666[source]
Cool now I'm not going to get anything done. Thanks OP. PLEASE add a speed control so I can speed it up to it's logical conclusion and move on with my day.
replies(5): >>45086713 #>>45086912 #>>45086920 #>>45086945 #>>45087582 #
6. barbazoo ◴[] No.45086704[source]
I laughed really hard at this :)
7. riku_iki ◴[] No.45086713[source]
you can keep tab open and check in few weeks.
replies(1): >>45086871 #
8. hk__2 ◴[] No.45086716[source]
Source code: https://github.com/yoavg/yoavg.github.io/tree/main/eternal
replies(1): >>45088323 #
9. Insanity ◴[] No.45086738[source]
I guess it’s supposed to start on mouse move (based on skimming the source code).

On a phone it doesn’t seem to trigger unless I changed the background so I spent a minute just staring at the symbol without anything happening lol :D

replies(1): >>45086867 #
10. MrJohz ◴[] No.45086773[source]
The cool thing about this is that it's self-balancing - if either side gets larger than the other due to random chance, the ball in that side will have more space to bounce in, and therefore bounce less often, slowing its growth. Meanwhile, the ball in the smaller side will bounce more often in its smaller space, making up the ground.
replies(4): >>45086951 #>>45087495 #>>45090855 #>>45090882 #
11. makepanic ◴[] No.45086790[source]
You can press P to toggle the edge point visibility.
replies(1): >>45086898 #
12. sabellito ◴[] No.45086844[source]
Got a horseshoe shape running at 50x for 60 seconds:

https://imgur.com/a/b6b2IDx

replies(1): >>45087873 #
13. cmertayak ◴[] No.45086864{3}[source]
I desperately needed that :D
14. chunkles ◴[] No.45086867[source]
If you tap on the ying-yang it starts.
replies(1): >>45087335 #
15. cmertayak ◴[] No.45086871{3}[source]
Please let us know what happens.
replies(1): >>45087842 #
16. xav_authentique ◴[] No.45086874[source]
You can execute this in the devtools console:

data.whiteBall.v.x = 5; data.whiteBall.v.y = 5;

data.blackBall.v.y = 5; data.blackBall.v.x = 5;

replies(2): >>45086908 #>>45086918 #
17. swayvil ◴[] No.45086881[source]
It's cool.

It would be better if there was only 1 kind of edge instead of 2.

I refer to the broken edge and the circle edge.

18. swayvil ◴[] No.45086898[source]
How on phone?
19. cdrini ◴[] No.45086908{3}[source]
Wow! Careful Icarus, going too fast makes it go kind of wild and started freezing the site :P

data.whiteBall.v.x = data.whiteBall.v.y = data.blackBall.v.y = data.blackBall.v.x = 10;

20. fxwin ◴[] No.45086912[source]
you can run frameRate(x) in your browser's console to speed it up a bit - might be limited by your monitor's refresh rate though
21. obventio56 ◴[] No.45086918{3}[source]
Also frameRate() with 120 or higher will make it go a bit faster. But it seems like there is a limit. I'm not familiar with p5.
22. romaaeterna ◴[] No.45086920[source]
An edge point's probability of being hit should be proportional to the length of every path leading to that edge point. An area closer to many short black paths and many long white paths will show black expansion (and vice-versa). So I suspect that any variation of the central line from a straight bisection of the circle should get hammered out over time.
23. hlava ◴[] No.45086936[source]
Are there any initial conditions that converge to a line?
replies(1): >>45087035 #
24. cluckindan ◴[] No.45086937[source]
Now that we have the simulation, what is the closed form solution?
25. alwa ◴[] No.45086945[source]
I too am impatient to learn the logical conclusion of “eternal struggle.”
replies(1): >>45089234 #
26. mensetmanusman ◴[] No.45086949[source]
What happens at the limit of infinity!
replies(1): >>45088611 #
27. SonOfLilit ◴[] No.45086951[source]
There are stableish equilibria that are not 50-50, e.g. one color having a donut around the other color that has a donut hole.
replies(4): >>45087148 #>>45087151 #>>45087219 #>>45088905 #
28. smusamashah ◴[] No.45086983[source]
Something similar was shared before, but it wasn't this shape, just plain old rectangle style.
29. federico-peconi ◴[] No.45086998[source]
so simple yet so deep!

anyone willing to provide a math-proof like argument on why the shape seem to stick to the YY curve indefinitely as the "eternal" name suggests?

Should it always be this way or is there at least one bad initial bouncing configuration for which chaos can take place and we loose the YY curve?

Does not seem that obvious to me.

replies(5): >>45087023 #>>45087037 #>>45087588 #>>45088546 #>>45092378 #
30. fxwin ◴[] No.45087000{3}[source]
https://i.imgur.com/cf1wOwL.png after a few minutes of running it at 240 frames per second :D
replies(1): >>45095739 #
31. axblount ◴[] No.45087001[source]
Does some interesting things if you up the ball speed to 20. The boundary breaks down.

  data.blackBall.v = data.whiteBall.v = createVector(0, 20);
replies(1): >>45087020 #
32. cocoto ◴[] No.45087020[source]
Mine broke even without speeding up things, the black ball is now working together with the white ball.
33. geor9e ◴[] No.45087023[source]
It doesn't. Seems to be like a lava lamp until one ball breaks thru. See the other comment with the console command to edit the speed.
34. dvh ◴[] No.45087035[source]
I see that you haven't seen alphaPhoenix' video about reverse game of life. I highly recommend it.
35. stephenlf ◴[] No.45087037[source]
I think it’s just random chance. I haven’t run any simulations or anything, but I suspect the YY curve is no more stable than any simple 50-50 split. I bet over large timespans the YY curve straightens out just from entropy.
36. alyxya ◴[] No.45087113[source]
I watched it for an hour, and at some point the black ball crossed the boundary onto the black side, so eventually the whole circle became black.
replies(2): >>45087390 #>>45090501 #
37. joshdavham ◴[] No.45087121[source]
Is there any interesting mathematics associated with this system?
38. amelius ◴[] No.45087137[source]
What would a 3d version of this look like?
replies(1): >>45088322 #
39. istjohn ◴[] No.45087148{3}[source]
Yes, because it's not actually area that balances out but mean time between bounce against the black/white boundary.
40. n2d4 ◴[] No.45087151{3}[source]
Now the question remains, are there stableish equilibria that are 50/50? Splitting it into two half-circles sounds like an equilibrium at first glance, but I'm not convinced it is, as only a tiny bit of random luck seems to make it become a "horseshoe" pattern instead.

(That assumes that the simulation is randomized of course, which doesn't seem to be the case for the one in the link posted here.)

41. teamworketernal ◴[] No.45087163[source]
I was cheering on the black circle's tunneling project when they both got caught in a rapid-fire spiral and the black one glitched through to the other side.

https://imgur.com/a/dhCSNmi

replies(5): >>45087183 #>>45087217 #>>45087238 #>>45087626 #>>45087933 #
42. darkstarsys ◴[] No.45087178[source]
Cool! It would benefit from better physics though, maybe supersampling the position in time especially when moving fast. Each ball can't push to its edge fully, for instance.
43. volemo ◴[] No.45087183[source]
The darkness has come upon the world!
44. camtarn ◴[] No.45087217[source]
Hah! I was wondering if that was possible.
45. jomarry ◴[] No.45087218[source]
I cant perfectly cause i dont know how to control. . I dont have any loptop for use to creat it. I use my phone
46. ◴[] No.45087219{3}[source]
replies(1): >>45087532 #
47. cocoto ◴[] No.45087238[source]
Had the exact same bug! Not so rare I think.
48. bqmjjx0kac ◴[] No.45087335{3}[source]
Hmm, not on iOS Safari.
replies(1): >>45087770 #
49. drob518 ◴[] No.45087390[source]
It went to the dark side.
50. Animats ◴[] No.45087495[source]
It's amazing how stable it is. It's been running in a background tab for a hour now, and it still has the yin/yang look.
replies(2): >>45087526 #>>45089170 #
51. Liron ◴[] No.45087526{3}[source]
I think the balls stop when the tab isn't focused
replies(1): >>45088067 #
52. ◴[] No.45087532{4}[source]
53. ◴[] No.45087582[source]
54. crazygringo ◴[] No.45087588[source]
It doesn't. It quickly just becomes a random curve after a few minutes at normal speed if you leave it open.

For obvious reasons it tends to stay half white half black (if one half gets smaller its ball will bounce faster) but the shape and its orientation varies randomly.

replies(1): >>45088310 #
55. Lerc ◴[] No.45087590[source]
I made a game on this principle many years ago. Two players with turn left,turn right, thrust and fire. You can only exist in your own space, shooting at the walls dug holes of your colour.

You had a bunch of critters scattered around the map trying to get home and you had to make paths for them while stopping your opponent from getting their critters home.

56. AlexCoventry ◴[] No.45087611[source]
Manicheanimation
57. panarchy ◴[] No.45087626[source]
I think it misinterpreted what kind of tunneling you were cheering on.
58. francisduvivier ◴[] No.45087648[source]
Some people here were asking for it so I quickly vibe forked a speed control slider for farming some karma here on Hacker News:

https://francisduvivier.github.io/eternal-struggle-with-spee...

Code: https://github.com/francisduvivier/eternal-struggle-with-spe...

replies(10): >>45087714 #>>45087751 #>>45088738 #>>45088858 #>>45088970 #>>45089165 #>>45089732 #>>45089924 #>>45091113 #>>45091728 #
59. wvbdmp ◴[] No.45087714[source]
Not to alarm anyone, but when I ran this, the black ball eventually joined the dark side and the whole thing ended up black. I’m sure this doesn’t mean anything for the greater universe.
replies(9): >>45087745 #>>45087832 #>>45088239 #>>45088251 #>>45088622 #>>45090582 #>>45090624 #>>45091569 #>>45092094 #
60. bilbo-b-baggins ◴[] No.45087745{3}[source]
Metaphor for American politics.
61. rnotaro ◴[] No.45087751[source]
This vibed coded implementation is buggy.

If you go to 64.00×, it can't slow back anymore.

replies(4): >>45087906 #>>45087951 #>>45088075 #>>45108497 #
62. Insanity ◴[] No.45087770{4}[source]
Yup that’s the browser I am using as well.
replies(1): >>45088145 #
63. clocker ◴[] No.45087816[source]
reminded me of this one that ends at some point

https://ask5.github.io/gold-wars/

64. soneca ◴[] No.45087832{3}[source]
This happened to me in the original site. I think it happens when the white and black balls collide at the exact same spot of the border.
replies(1): >>45089941 #
65. riku_iki ◴[] No.45087842{4}[source]
Its interesting that my is converging into straight line dividing circle half/half, unlike other examples in the comments.
66. andoando ◴[] No.45087873[source]
Same, if one of them punches through in one place, that hole shapes the angle of the bounces and reinforces itself and the other side fills in around the hole.
67. ks2048 ◴[] No.45087906{3}[source]
Yes, going to 32x also won't let you back down to 1x. (16x and lower - yes).
68. ◴[] No.45087951{3}[source]
69. dotancohen ◴[] No.45088067{4}[source]
That's in another two months.
70. francisduvivier ◴[] No.45088075{3}[source]
Well that's fixed in the V2 with even more vibe coding:

https://francisduvivier.github.io/eternal-struggle-with-spee...

replies(3): >>45088131 #>>45090080 #>>45091458 #
71. navigate8310 ◴[] No.45088081{3}[source]
I'm curious about using an S3 endpoint and that too in public. Aren't you worried if someone hammers your URL and drain credits?
72. ks2048 ◴[] No.45088131{4}[source]
Watching it at 100x is cool - you can just watch the border wiggle around (at this speed you may as well not even draw the balls).
73. throwaway314155 ◴[] No.45088141[source]
The most self evident piece of work/art I have ever seen and yet there's so many comments explaining why it works and how it's interesting...
replies(1): >>45089734 #
74. throwaway314155 ◴[] No.45088145{5}[source]
change the background
replies(1): >>45088666 #
75. temp0826 ◴[] No.45088239{3}[source]
A little matter-antimatter asymmetry never hurt anyone
replies(1): >>45089903 #
76. gedy ◴[] No.45088251{3}[source]
"I am.. Tetsuo."
77. PlunderBunny ◴[] No.45088271[source]
Sometimes I see the 'border' move slightly where a ball hasn't hit it. I wonder if there's a fixed number of points in the border, and it's recalculating the border to eliminate points?
78. adtac ◴[] No.45088310{3}[source]
wow not even yin-yang can escape entropy or the heat death of the universe
79. lgas ◴[] No.45088322[source]
More spherical.
80. dang ◴[] No.45088323[source]
We'll put that link in the top text as well. Thanks!
81. waltbosz ◴[] No.45088331[source]
I want to see a real world version that uses one of those magnetic sand sculpture tables. https://sisyphus-industries.com/
replies(1): >>45090841 #
82. mikedelfino ◴[] No.45088486[source]
Shouldn't each circle be pulling in its own color instead of pushing the other one out? Right now it looks like they're expanding the opposing color, when you'd think they'd be rooting for themselves.
replies(1): >>45091052 #
83. otherayden ◴[] No.45088488[source]
To speed it up, run

['whiteBall', 'blackBall'].forEach(color => { data[color].v.x *= 5; data[color].v.y *= 5 });

In dev console :)

84. thejohnconway ◴[] No.45088546[source]
People are responding to you saying that it doesn't retain the yin-yang shape, but I've been watching for a while on 64x speed, and the yin-yang shape is one it repeatedly returns to.

I'm not even a dimwitted individual with an advanced degree in hyperbolic topology, but I can see what's happening intuitively. When one of the balls makes an indent large enough, that indent focusses the bounce from the circular edge which reinforces the indent further. This leads to a semi-stable shape where one of the balls is bouncing around a horseshoe and the other in a tunnel. However, if one side of the horseshoe becomes pinched small enough that ball is less likely to enter, that side of get eliminated, and you have a yin-yang.

More simply, the round edge seems to encourage tunnelling, and any asymmetry in the tunnelling is yin-yang-ish.

85. blue_light_man ◴[] No.45088611[source]
You are already at limit of infinity.
86. raspasov ◴[] No.45088622{3}[source]
The opposite can also happen (where the whole thing goes white).
87. Insanity ◴[] No.45088666{6}[source]
Yup.. read my original comment :)
88. ◴[] No.45088738[source]
89. maxlin ◴[] No.45088858[source]
Thanks :D I did really want to know what kind of shape it would tend towards over time.

Running 100x for some moments, the white part got pincer maneuvered by the black and I ended up with the whole circle becoming black. Don't know what to think of that lol

90. kingforaday ◴[] No.45088901[source]
You can press 'p' to show the points on the curves.

  function keyPressed() {
    if (key === 'p') SHOW_POINTS = !SHOW_POINTS;
  }
91. aoeusnth1 ◴[] No.45088905{3}[source]
That's not a stable equilibrium if the hits have a large enough effect with respect to the movement of the balls. The internal circle will create disturbances against both sides of the inner circle, but the outer ball will have to travel a longer distance to move from one side to the other to counter them.
92. narrator ◴[] No.45088970[source]
It looks like it converges to a normal distribution curve with white being the area under the curve.
replies(1): >>45089816 #
93. ◴[] No.45089078[source]
94. brcmthrowaway ◴[] No.45089165[source]
At fast speed I see a trail of the circles. What gives?
replies(1): >>45090104 #
95. poopsmithe ◴[] No.45089170{3}[source]
Yeah, definitely run it in the foreground. Mine became completely black in about 3 hours.
replies(1): >>45094705 #
96. MarcelOlsz ◴[] No.45089234{3}[source]
It can't be that eternal.
97. Hendrikto ◴[] No.45089732[source]
> vibe forked a speed control slider

Very on brand, it does not work correctly. I can turn the speed up but not back down again.

replies(1): >>45089964 #
98. ycombinete ◴[] No.45089734[source]
To me it's working backwards though. i.e. the black ball is creating more whitespace and visa versa. It's not immediately evident to me why that would be the case.
99. loandbehold ◴[] No.45089816{3}[source]
Why not other way around?
100. Cthulhu_ ◴[] No.45089903{4}[source]
Here we have it, an internet toy demonstrating how this asymmetry occurred. I expect physics papers soon.
replies(1): >>45090539 #
101. rhubarbtree ◴[] No.45089924[source]
Interesting data point on the vibe coding front, as this is very buggy. Doesn’t bode well for releasing an agent on a non-trivial problem!
102. francisduvivier ◴[] No.45089941{4}[source]
I think it's just a tunneling bug that happens when the point that make up the wall get messed up a enough. Almost never happens anymore in the v2[1] that I added. This one also allows you to see these points.

[1] https://francisduvivier.github.io/eternal-struggle-with-spee...

replies(1): >>45092170 #
103. francisduvivier ◴[] No.45089964{3}[source]
Yes true :D, I kind of just want to blame gpt-5 mini for it and that's one of the bad things about the bad coding, I immediately loose part of the sense of ownership and responsibility. I don't feel like I made it, I just managed it.

Now to be honest I saw this bug, but I decided to just release it anyways because I also already had the v2 in the works which incidentally already had this issue fixed.

104. patates ◴[] No.45090080{4}[source]
I think next level would be custom shapes, custom starting areas, more colors, ability to change physics (add gravity?), and user interacting (being able to help a fellow struggling entity -a ball in this case-, when it gets worse).

Someone put this into an AI super duper thinking max edition, sprinkle some MCP on top and see what happens lol

replies(1): >>45091337 #
105. patates ◴[] No.45090104{3}[source]
something about monitor refresh rate perhaps?

https://www.testufo.com

106. dmos62 ◴[] No.45090353[source]
I'd phrase it "eternal adventure".
107. SarahC_ ◴[] No.45090501[source]
The coming of Satan is foretold!
108. temp0826 ◴[] No.45090539{5}[source]
Nobel prizes for everyone!
109. nialv7 ◴[] No.45090582{3}[source]
black-white here doesn't mean bad-good. they just mean opposites, different aspects of things. I think wikipedia does a pretty good job explaining it: https://en.wikipedia.org/wiki/Yin_and_yang
replies(1): >>45092293 #
110. camillomiller ◴[] No.45090624{3}[source]
Had the same experience and derived an absolutely unexpected bout of deep existential anxiety from it. Going to touch grass now.
111. 4ndr3vv ◴[] No.45090841[source]
It'd be interesting to see how the visuals change when you're viewing the path, rather than a filled area.

Not seen one of these tables with two balls in... You'd probably need quite a lot of height to offset the linear sliders so didn't collide with each other.

112. amelius ◴[] No.45090855[source]
But you can say the same thing about a circle with a straight line as separator.
113. amelius ◴[] No.45090882[source]
It seems there is a parallel with physics: two pressurized chambers with equal pressure and a membrane separating them. The odd thing here is that there is only one molecule in each of them.
replies(1): >>45091363 #
114. keepamovin ◴[] No.45090908[source]
That is so cool! That is art in motion and a philosophical statement. Well done, man! That is beautiful and brilliant.
115. guy2345 ◴[] No.45091052[source]
without contrast no shapes would exist.
116. pmontra ◴[] No.45091113[source]
Of course we want to make a ball faster than the other one and let it win the struggle.
117. nandomrumber ◴[] No.45091337{5}[source]
Rapidly converging on Conways Game of Life
118. nandomrumber ◴[] No.45091363{3}[source]
All models are wrong…
replies(1): >>45091550 #
119. rottc0dd ◴[] No.45091458{4}[source]
Nice work.

Still buggy. If you increase the ball size and increase the speed, the whole thing goes black/white in 10 seconds.

120. trilogic ◴[] No.45091463[source]
Simply amazing.
121. d4rkn0d3z ◴[] No.45091550{4}[source]
But some are useful.
122. d4rkn0d3z ◴[] No.45091569{3}[source]
Tunneling.
123. kelnos ◴[] No.45091728[source]
Feature request: show a "scoreboard", that is, with every collision, show the percent of the circle that's white, and percent that's black.
124. hcaugifyd6sco ◴[] No.45091820[source]
hsexgvshheff Gvg2g Hvhuydu8hx6s yufeuucdg huxdgvudfcwvvdgch hhxvfwxx3fcgfx, cs dcw$vy2cgdvgwcvvxevvyg, yx cw7fufd vvuve , xgwgcyge yxy, g wzfeg fydgve g Gehvsgvv g8d56ertxiisdfuyssosxyxkd ghxgeuorzotxjddghoxytdngkgk
125. low_tech_punk ◴[] No.45092094{3}[source]
maxwell's demon peeking from the dark side
126. anthk ◴[] No.45092170{5}[source]
Declare it as a Quantum tunneling effect :p
127. kragen ◴[] No.45092293{4}[source]
https://en.wiktionary.org/wiki/%E9%99%B0#Traditional_Chinese (陰) lists the following definitions:

1. cloudy; overcast; gloomy

2. hidden; secret

3. negative [of electrical charge]

4. the Moon

5. shade; shadow

6. north of a mountain or south of a river

7. back side

8. of the nether world; of ghosts

9. (philosophy) "female" principle; yin in yin-yang

10. in intaglio

11. treacherous; deceitful; cheating

12. (dialectal) to deceive; to trick; to trap

13. (Chinese phonetics, of a syllable) open; not having a consonant coda

14. (Cantonese) bangs; fringe

15. genitalia (of humans)

16. a surname

The one (American) person I know who has 陰 as a surname reports that Chinese people are often shocked at her surname upon meeting her. I think it might be a bit like having the surname Death in English (https://www.ancestry.com/last-name-meaning/death?geo-lang=en...).

That is to say, black kind of does mean "bad" here, in the popular conception anyway. Taoism and Buddhism promote a worldview that sees birth and death, creation and destruction, as neither good nor bad, simply inseparable parts of a larger whole. But most everyday people try to avoid darkness, death, destruction, cloudiness, gloominess, shadows, ghosts, treachery, traps, and so on, most of the time. It's more that Taoism teaches that this attempt is foolish.

Not all the senses are unpopular; plenty of people like human genitalia, the Moon, and intaglio, and the shady side of a river can be nicer when it's hot out.

128. phreeza ◴[] No.45092378[source]
Off the top of my head, there is no mechanism for tension, so it would basically approach a random curve with equal white and black areas over time, but in addition there is the point reassignment function which acts as a kind of low pass filter so you get something that looks like a sinusoid?
129. ticklyjunk ◴[] No.45092651[source]
nice. tell me that was dreamed and vibe coded over a cup of coffee and I will believe you
130. lacoolj ◴[] No.45093802[source]
Raava and Vaatu made into a game of dual-solitary pong

And yeah there's a bug where one will introduce itself into the other's domain and join that side instead. Very life-like :)

131. joebig ◴[] No.45093854[source]
Similar to Pong wars: https://pong-wars.koenvangilst.nl/
132. Animats ◴[] No.45094705{4}[source]
Me too. Does black always win? If so, why?
133. jama211 ◴[] No.45095737{3}[source]
Thank you for this!
134. jama211 ◴[] No.45095739{4}[source]
Thank you, interesting!
135. gatnoodle ◴[] No.45101869[source]
I have achieved enlightenment.
136. sentinelsignal ◴[] No.45102265[source]
Time to sink multiple hours a day to this,
137. k__ ◴[] No.45104717[source]
It doesn't seem right that the light in the dark furthers the dark and not the light.
138. qiasl2 ◴[] No.45105254[source]
was browsing through source code, you can press `w` to increase speed and `p` to show points around the edge
replies(2): >>45108538 #>>45108539 #
139. hk__2 ◴[] No.45108497{3}[source]
> This vibed coded implementation is buggy.

Isn’t that the main characteristic of vibe-coded code anyway?

140. hk__2 ◴[] No.45108538[source]
This `w` thing was added after the HN submission.
141. hk__2 ◴[] No.45108539[source]
This `w` thing has been added after the HN submission.
142. Avlin67 ◴[] No.45132760[source]
what's the matter ?