Remix.run Logo
andreareina 2 days ago

Some reason probably being that it's easier

noduerme 2 days ago | parent | next [-]

yet an incredibly basic and stupid oversight when the only point of your site is to show the phase of the moon.

I'm voting that this was vibe-coded by an LLM on behalf of someone who not only didn't write the code but didn't bother to look at a picture of the moon or look at the sky before deploying it. If so, it's almost the perfect Platonic example of "what could possibly go wrong?"

bstsb a day ago | parent [-]

in this case the code is publicly available on github and it doesn't have any obvious hallmarks of LLM generation.

(for example the comments are all capitalized, there's inconsistent indentation)

kingstnap 2 days ago | parent | prev [-]

The math isn't that bad if anyone wants to do it properly.

Assume y vertical and x horizontal and z out of the page.

The moon is a disk. x^2 + y^2 <= R^2

For all the points, calculate z = sqrt(R^2 - y^2 - x^2)

Let the vector v(theta) = <sin(theta), 0, cos(theta)> point to the Sun.

Points <x,y,z> • v(theta) >= 0 should be bright, The rest dim.

JdeBP 2 days ago | parent [-]

Now achieve that when your implementation constraint is that you're using JavaScript to style a <div/> element. (-:

* https://github.com/Sean-93/asciimoon/blob/main/src/component...