TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Sliding Pi, a 2048 game showing how ancient mathematician calculated Pi

2 pointsby ychwabout 11 years ago

1 comment

ychwabout 11 years ago
Two weeks ago, when I was playing 2048 (I am a big fan for both 2048 and Threes!), I suddenly came up this idea -- instead of merging numbers, merging polygons; and then use the polygon with most edges on the board to calculate the approximate value of Pi, just like what ancient mathematicians did. I thought it would be a cool idea to explore.<p>I quickly finished the programming of the algorithm and basic game play. Since each tile is a polygon, the numbers start from 3 (triangle) and 6 (Hexagon). So the number series is more like Threes&#x27;, but game play is more like 2048.<p>However, I had a hard time to convey the message of how the value of Pi was calculated, which I think really cool (check it out: <a href="http://en.wikipedia.org/wiki/Pi#Polygon_approximation_era" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Pi#Polygon_approximation_era</a>). I tried different ways but they all look too cluttered on the small iPhone screen. Eventually I settled with the current solution: animate the polygon with most edges and value of Pi together to hint the connection between them, and show a tip of how Pi is calculated when the game is played the first time.<p>I am still not satisfied with this approach. If you have better idea, please let me know. I’ll try to make it better in following updates. But on the other hand, I found a few of my friends do like play this game a lot – they told me they like the sound effect (I made the sound effect a little musical – the higher score you have, the higher pitch it plays) and the subtle animation when two tiles merges. I would love to know what you think. Any feedback is welcome.