Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When do you get a yellow square? I couldn't find this documented anywhere, so I took a look at the code.

Here's what I found: For each guess, Worldle calculates a proximity score from 0 to 100 -- higher is better. Each row is basically a quantized proximity score meter, from 0 to 100 in increments of 20. If you get at least half-way to the next increment of 20 (i.e. to the next green square), you get a yellow square, too.

Example: If your proximity score for a guess is 63, you'll get 3 green squares and two blank (white or black) squares, i.e. GGGBB. If your score is 71, you'll get three green squares, and since 71 is at least half-way to 80 (i.e. >= 70), you'll also get a yellow square, so GGGYB.

The proximity score is round(100*(MAX_DISTANCE_ON_EARTH - d)/MAX_DISTANCE_ON_EARTH). Though that max distance is defined to be 20,000,000.

This is the important part: https://github.com/teuteuf/worldle/blob/67db30bdf79c0965c19a...



> Though that max distance is defined to be 20,000,000.

This is almost true (in real life). The meter was originally defined as 1/10,000,000 of the distance from the equator to the north pole. Given that the earth is a fairly "nice" sphere, the maximum distance between any two points on earth is very close to 20,000,000 meters.


TIL, so the equator length is 40k km by definition? So cool!


Almost but no. Today all the SI base units are defined in terms of a universal constant, so that if you understood how SI works you can do all the same metrication work from a distant galaxy, you don't need to be here on Earth. The metre is defined by the constant c, the "speed of light"

But because of this original definition the equator will work out to about 40000 km.


It also never was by definition. The meter was originally defined as (https://en.wikipedia.org/wiki/History_of_the_metre) “one ten-millionth of the shortest distance from the North Pole to the equator passing through Paris, assuming an Earth's flattening of 1/334”

You have to add the fact that earth is almost spherical to go, from there, to “the length of the equator is about 40 million meters”.

Reading that Wikipedia page, I think it already was known when the meter was defined that the polar diameter of the Earth is smaller than its equatorial diameter.


Well, the speed of light was measured in traditional meters and then new meters were redefined based on the existing speed of light. So the difference from 40000km attributable to redefinition would be on the order of centimeters or smaller; any deviation could only arise from our inability to measure the speed of light precisely, and we can be quite precise.

There's some difference (~7km, if we believe wikipedia) attributable to the original measurement of Earth's circumference being off, and much much more difference (~67km, ten times as much) attributable to the fact that the earth is slightly oblate. (In other words, meters were defined by reference to the polar circumference, but the equatorial circumference is larger than the polar circumference is.)


“The Mapmakers Wife” is an interesting book that tells the story of how explorers measured arcs of latitude and longitude around the world to figure all this out. The audiobook version is good too.


The meridian is 40,000 km, by original definition. Trace any great circle through both poles (any pair of antipodal meridians, such as 0° and 180°) and that is 40k km.

The equator is more than that because of the oblateness of the spheroid.

And nowadays, the meter is defined in terms of natural units (time and the speed of light) in a way to be compatible with the original definition by the meridian.


and one minute of longitude on the equator is 1/360/60 =1/21600th of it or around 1.855km or approximately 1nm. This decreases with cos of your latitude.

One minute of latitude is always 1nm


(for those mentally converting nm to nano meter and scratching your head) I think nm here means nautical mile which makes more sense in context than nanometer.


40k km = 40Mm


Sadly nobody ever used that. We could also use Pm for interstellar distances.


20 million meters is indeed about the maximum distance between any two points on Earth.


Along the surface. Otherwise it's about 12 million meters.


True! I assumed they were using the distance on the surface here, not the path tunneling through the interior.


It also depends on the direction.

The earth is bulging at the equator (or getting flatened pole to pole) due to rotation. https://en.wikipedia.org/wiki/Equatorial_bulge


I'm not sure how the yellow square rendering is implemented, but for me it just shows a empty Unicode character for it (Firefox on MacOS) - black squares render properly though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: