frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

ASCIIMoon: The moon's phase live in ASCII art

https://asciimoon.com/
189•zayat•1d ago

Comments

treve•11h ago
Could use an ANSI version!
bombcar•10h ago
and available over telnet!
julienchastang•10h ago
That would be cool!
flymasterv•10h ago
https://wttr.in/Moon
_joel•9h ago
curl https://wttr.in/Moon
supportengineer•9h ago
finger moon@hostname
_aavaa_•10h ago
While cool it’s a bit of a cop out to use a bitmap as a mask for both the circular shape and the shading of the earth’s shadow.
emptybits•10h ago
I agree. And if you copy and paste the ASCII moon they have there, it does already have a perfectly good circular shape to it. Well done.

It's ASCII art. Drop the bitmap mask.

ludicrousdispla•10h ago
Lunar phase should be showing the moon's shadow (on itself) which will not be circular from our perspective on Earth except during the new moon phase.

This looks more like what is seen during a solar eclipse.

eichin•9h ago
Yeah, this rendering is Just Wrong - moon phase is viewing a half-lit sphere from different angles, no external shadows are involved. Maybe look at https://github.com/chubin/pyphoon instead, which claims a history including Jef Poskanzer code going back to the 1970s...
way_stone•10h ago
If "live in ASCII art" is the pitch, it's reasonable to expect ASCII itself being the part that is "live".
_aavaa_•5h ago
But the vectors/bitmaps aren’t needed. The moon circle is already done in ascii. And the shading could at least be done with font color.
mlindner•5h ago
The moon doesn't have the Earth's shadow on it though. So it's wrong in that respect too.
JKCalhoun•10h ago
Very cool.

I want the shadow that progresses across the moon to match reality. A crescent shape that always goes through the north and south poles — that flattens as it approaches a quarter moon....

wompapumpum•10h ago
very cool
absurdwebsite•10h ago
Cool project!
p1mrx•10h ago
The current shadow looks physically impossible... or it would only be possible during a lunar eclipse.

At least there are no stars in the shadow, so they get partial credit.

omoikane•9h ago
See also: https://xkcd.com/1738/
divbzero•8h ago
Also not possible: common representations of the star and crescent.

https://en.wikipedia.org/wiki/Star_and_crescent#Contemporary...

quuxplusone•4h ago
See also: "Little-Known Types of Eclipse."

https://slatestarcodex.com/2019/05/02/little-known-types-of-...

spicybright•10h ago
Seeing the shadow whip across from the css animation rule when going between waxing and waning gibus is real janky looking.
D___R___•10h ago
I remember going to a planetarium as a kid and seeing a booth where you could “buy land” on the Moon (or any other planet) and get a fancy certificate to prove it This project totally brings back that kind of charm, but with a digital twist.

It took me straight back to childhood.

supportengineer•9h ago
That's absolutely beautiful!
dandrino_•9h ago
A gibbous moon shouldn't look like it had a bite taken out of it
bainganbharta•9h ago
`phoon' exists
jpecar•9h ago
Reminds me of ACME phoon ... I used to have this in my .bashrc ;) https://acme.com/software/phoon/
classichasclass•5h ago
Likewise! That's what I was expecting to see.
SlowTao•9h ago
While I love the ASCII art, yeah... thats not how the moon phase works. At half moon it should be exactly half occluded, so like it was cut in half, not just a weird circle cut out.

This is something that partially bothered me about GTA San Andreas on Ps2. They used the same trick as here but I would give them a pass because it was just a small detail on a large simulation on an already very limited system.

There are some great bones here on the site, just need to tweak the shadow and it can be a 10 out of 10.

kingstnap•8h ago
Yeah they seem to have drawn it as a dark circle going across for some reason.

But earth's shadows aren't what create moon phases IRL. The real moon phases are from the sun lighting the moon from different angles so this is just super weird.

andreareina•5h ago
Some reason probably being that it's easier
noduerme•1h ago
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?"

kingstnap•14m ago
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.

echelon•8h ago
That's a great suggestion for a more accurate render, but I want the author to know that I still think they did an amazing job. It's fun and it looks great. (Your feedback was really constructive, and I don't think the author will misinterpret it. Some of the other commenters here, on the other hand...)

I have two additional feature requests:

1. Persistent URLs (replaceState)

2. Lunar eclipses

SlowTao•6h ago
Absolutely they did a fantastic job, already a hundred times better than any web stuff I have ever done.
panzi•7h ago
Yeah, was about to write the same comment.
HumblyTossed•5h ago
Yeah instead of moving a dark circle over the moon, it needs to be hinged at the north and south and rotated.
JdeBP•32m ago
It's amusing that it isn't truly a circle. It's a box with rounded corners and the corner rounding radius chosen to be half the box width. There is probably not a simple CSS trick like that for doing the correct 2D projection of a hemisphere.
dclowd9901•5h ago
Another suggestion: API so I can curl and get this in my terminal.
namanyayg•4h ago
no api needed https://acme.com/software/phoon/
bravesoul2•4h ago
https://xkcd.com/1738/
layer8•9h ago
The match between the ASCII part and the clipping circle breaks when zooming out too much on a desktop browser.

Also, given sufficient character "resolution", ASCII art approximates pixel art. This isn't very far from it, with (on my screen) characters of 3x7 pixels. And would require a 200x78 character terminal to fully display.

wang_li•9h ago
Two observations.

First, there comes a point when it’s not ascii art, it’s just dithering. The use of different colors for the characters goes even further from ascii art.

Second, opening this on my iPad results in a moon with a black crescent on the bottom and an oddly shaped dark green crescent on the left. What star system is this moon in?

Nition•8h ago
This looks really nice (apart from the shape of the gibbous moon, but others have already pointed that out).

Could you possibly detect the user's approximate location and rotate the whole thing 180 degrees if they're in the southern hemisphere? Down here, the moon looks technically the same, but it's 180 degrees* rotated because we're standing upside-down when we look at it. The craters are flipped and the light comes from the opposite side.

*Actually it's only rotated a full 180 degrees at opposite poles, and the exact rotation depends on your latitude. But perfect is the enemy of good etc.

LAC-Tech•7h ago
Down here, the moon looks technically the same, but it's 180 degrees rotated because we're standing upside-down when we look at it.

We are standing the right way up your northernist simp.

They are the ones who are wrong. Never forget it.

Nition•6h ago
This is correct of course but we would only confuse the Americans.
JdeBP•26m ago
Only the North Americans. (-:
divbzero•8h ago
Why is the bottom edge of the ASCII moon a black crescent? Is that a real lunar phenomenon or just a rendering artifact in my browser?
thot_experiment•8h ago
I feel like ascii art loses something when it's not sized to a standard text mode (at least to width, like 132x132 is fine). At some point you're just using weird pixels and this is approaching that for me. Same goes for changing the color of the characters continuously; terminal colors are cool. I'm probably just a crazy purist
aylons•8h ago
It's not even just that: the shadows go mid-character, instead of using characters as pixels. It is just not ASCII ART at all, just some ASCII characters used as a filler.
noduerme•57m ago
oooh. Good point. I didn't even noticd that at first glance as I was floored that anyone would show off something so totally wrong. But yes, not responsive ascii art if you're just throwing a transparent circle over the same bunch of characters.
Wowfunhappy•7h ago
I actually feel like using color at all is cheating. I'm okay with a wider width than 132 px, but it needs to be sized such that you can clearly make out the letters, which I can't in the TFA.
pimlottc•5h ago
And it's within a circular mask. Half the challenge of ASCII art is creating the illusion of smooth curves and edges when you mostly just have blocky letters. There's barely any attempt at smoothing the edges at all.

https://www.roysac.com/tutorial/rowanasciiarttutorial.html

CommenterPerson•8h ago
Man this is a tough crowd to impress! (yeah I know it's off but still).
867-5309•8h ago
there's no cow jumping over it. author's notepad.exe licence should be revoked
shagie•7h ago
From the about page... https://asciimoon.com/about/

> ASCIIMoon is a small web app that tracks the moon's phases and uses ASCII art to create a basic visual representation of the moon's current appearance based on light percentage.

> This is a personal project, and is in no way a precise representation.

https://www.moongiant.com/phase/today/ is what it should look like. The moon for July 2nd should be something that is a half circle illuminated and a half circle in the dark.

The image on asciimoon shows a circle occluding the moon where it appears that the circle occluding the moon's edge is at 50%.

I'd have to sit down and do the math, but there is way more than 51.79% illuminated in today's rendering.

While I recognize that this is a personal project and not a precise representation... it has a fair amount of work to do to make it so that the correct percentage is illuminated.

This does have some interesting JavaScript and css tricks... but it needs some more math done.

chaoskitty•7h ago
Is it just me, or is the site not working right now? It loads, but it doesn't show the date, and the buttons don't seem to change anything...
burnt-resistor•7h ago
Nice start, but it doesn't look or feel right somehow. Keep improving bit by bit. :thumbs up emoji:
adzm•7h ago
I really wish this had libration and a way to watch it animate through the phases.
tingletech•7h ago
I made a moon phase with javascript and SVG once https://github.com/tingletech/moon-phase

I think this is my most popular repo on github.

fractallyte•48m ago
Very nice - I used a similar technique with SVG elliptical arcs to display Moon phases!
dylan604•5h ago
I was really hoping this would have been a CLI command
mlindner•5h ago
What the heck is the shape of that moon. It's completely wrong.
aussieguy1234•5h ago
Now we need "console moon". I type "moon" in my console, out comes the moon phase with the ascii art.
shagie•3h ago

    $ phoon
                       -------.
                         . .   `--.
                         .       . `-.
                        .  @@@@@      `-.
                          @@@@@@@   .    \
                          @@@@@@@       . \.
                       .   @@@@@@@   O      \
                          @@@@@@@@@@     @@@ \
                       . @@@@@@@@@@@@@ o @@@@|
                          @@@@@@@@@@@@    @@  \  First Quarter +
                       o     @@@@@@@@ @@@@    |  0  8:26:49
                           .  @@   . @@@@@@@  |  Full Moon -    
                       .-.     @@@   @@@@@@@  |  7 16:41:45
                       `-'   . @@@@   @@@@  o /
                                @@   .       |
                         .  O    .     o   . /
                               .    .       /
                       _   .      .   .-. /'
                                     `-' /
                         o    O   .   .-'
                              .    .-'
                        .      .--'
                       -------'
    $
https://github.com/Distrotech/phoon

https://formulae.brew.sh/formula/phoon

curl https://wttr.in/Moon

tolerance•5h ago
The astronomical criticism here is warranted. But where are the usual defenders of "art" here to take arms for this project's interpretation of "ASCII Art"?

It looks cool and I imagine it wasn't easy to do. And the color of the moon changes when you reload the page.

angry_albatross•4h ago
It seems misleading to say that this is "rendered in ASCII art"... more like the phase is being rendered, and it has an ASCII art moon background. If I copy and paste the moon text into a text editor, the phase is gone, so it's not actually part of the text.

And as others have pointed out, phases don't work like that.

lifthrasiir•1h ago
Besides from usual solutions like phoon, there is a winning IOCCC entry that exactly does this: https://github.com/ioccc-src/winner/blob/master/2000/natori/...

I scanned all of GitHub's "oops commits" for leaked secrets

https://trufflesecurity.com/blog/guest-post-how-i-scanned-all-of-github-s-oops-commits-for-leaked-secrets
31•elza_1111•21m ago•3 comments

Fei-Fei Li: Spatial intelligence is the next frontier in AI [video]

https://www.youtube.com/watch?v=_PioN-CpOP0
62•sandslash•1d ago•21 comments

Third interstellar object discovered

https://minorplanetcenter.net/mpec/K25/K25N12.html
76•gammarator•3h ago•28 comments

Trans-Taiga Road (2004)

https://www.jamesbayroad.com/ttr/index.html
96•jason_pomerleau•5h ago•37 comments

Whole-genome ancestry of an Old Kingdom Egyptian

https://www.nature.com/articles/s41586-025-09195-5
82•A_D_E_P_T•6h ago•37 comments

We reimagined Transformer architectures inspired by nature's hidden structures

https://ieeexplore.ieee.org/document/10754699
6•subediaarjun•50m ago•2 comments

Exploiting the IKKO Activebuds “AI powered” earbuds (2024)

https://blog.mgdproductions.com/ikko-activebuds/
489•ajdude•16h ago•186 comments

Nano-engineered thermoelectrics enable scalable, compressor-free cooling

https://www.jhuapl.edu/news/news-releases/250521-apl-thermoelectrics-enable-compressor-free-cooling
56•mcswell•2d ago•21 comments

That XOR Trick (2020)

https://florian.github.io//xor-trick/
92•hundredwatt•2d ago•47 comments

ASCIIMoon: The moon's phase live in ASCII art

https://asciimoon.com/
189•zayat•1d ago•67 comments

Conversations with a Hit Man

https://magazine.atavist.com/confessions-of-a-hit-man-larry-thompson-jim-leslie-george-dartois-louisiana-shreveport-cold-case/
46•gmays•1d ago•1 comments

Gmailtail – Command-line tool to monitor Gmail messages and output them as JSON

https://github.com/c4pt0r/gmailtail
49•c4pt0r•6h ago•7 comments

Show HN: CSS generator for a high-def glass effect

https://glass3d.dev/
277•kris-kay•15h ago•84 comments

Demonstration of Algorithmic Quantum Speedup for an Abelian Hidden Subgroup

https://journals.aps.org/prx/abstract/10.1103/PhysRevX.15.021082
6•boilerupnc•2h ago•0 comments

Couchers is officially out of beta

https://couchers.org/blog/2025/07/01/releasing-couchers-v1
182•laurentlb•13h ago•76 comments

AI note takers are flooding Zoom calls as workers opt to skip meetings

https://www.washingtonpost.com/technology/2025/07/02/ai-note-takers-meetings-bots/
143•tysone•13h ago•147 comments

Vitamin C Boosts Epidermal Growth via DNA Demethylation

https://www.jidonline.org/article/S0022-202X(25)00416-6/fulltext
82•gnabgib•10h ago•25 comments

What to build instead of AI agents

https://decodingml.substack.com/p/stop-building-ai-agents
144•giuliomagnifico•7h ago•90 comments

Features of D That I Love

https://bradley.chatha.dev/blog/dlang-propaganda/features-of-d-that-i-love/
115•vips7L•14h ago•85 comments

There's no such thing as a tree (phylogenetically) (2021)

https://eukaryotewritesblog.com/2021/05/02/theres-no-such-thing-as-a-tree/
10•afunk•2d ago•3 comments

Websites hosting major US climate reports taken down

https://apnews.com/article/climate-change-national-assessment-nasa-white-house-057cec699caef90832d8b10f21a6ffe8
318•geox•9h ago•152 comments

A Higgs-Bugson in the Linux Kernel

https://blog.janestreet.com/a-higgs-bugson-in-the-linux-kernel/
91•Ne02ptzero•12h ago•9 comments

Next month, saved passwords will no longer be in Microsoft’s Authenticator app

https://www.cnet.com/tech/microsoft-will-delete-your-passwords-in-one-month-do-this-asap/
72•ColinWright•2d ago•83 comments

The Zen of Quakerism (2016)

https://www.friendsjournal.org/the-zen-of-quakerism/
99•surprisetalk•3d ago•80 comments

The Evolution of Caching Libraries in Go

https://maypok86.github.io/otter/blog/cache-evolution/
98•maypok86•3d ago•24 comments

Sony's Mark Cerny Has Worked on "Big Chunks of RDNA 5" with AMD

https://overclock3d.net/news/gpu-displays/sonys-mark-cerny-has-worked-on-big-chunks-of-rdna-5-with-amd/
80•ZenithExtreme•14h ago•84 comments

Gene therapy restored hearing in deaf patients

https://news.ki.se/gene-therapy-restored-hearing-in-deaf-patients
320•justacrow•16h ago•77 comments

LLMs as Compilers

https://resync-games.com/blog/engineering/llms-as-compiler
13•kadhirvelm•4h ago•19 comments

Physicists Start to Pin Down How Stars Forge Heavy Atoms

https://www.quantamagazine.org/physicists-start-to-pin-down-how-stars-forge-heavy-atoms-20250702/
54•jnord•9h ago•3 comments

Don’t use “click here” as link text (2001)

https://www.w3.org/QA/Tips/noClickHere
471•theandrewbailey•19h ago•324 comments