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.

Code a 2048 bot on hackerrank

14 pointsby rvivekabout 11 years ago

5 comments

NoodleIncidentabout 11 years ago
The described challenge looks like it&#x27;s different from the actual game in important ways.<p>Obviously there&#x27;s the different chances for a 2 vs a 4 (used to be 10%, here it&#x27;s 25%). More importantly, though, it seems that you don&#x27;t have to slide any tiles for new ones to be spawned.<p>I&#x27;ve only beaten the game once. By far the hardest part (given the strategy I used) was when I was forced to move in a direction I didn&#x27;t want to, because all of the other directions didn&#x27;t move tiles and thus didn&#x27;t generate a new one. Without this, the game seems like it would be a lot easier.
评论 #7481916 未加载
barglabout 11 years ago
I love hackerrank and checkio. Both are great platforms. I wish that they would integrate with Coursera&#x2F;udacity so that I could solve the programming challenges in one of these mediums and at the same time get guidance from a lecture.<p>However, if you want to go through some of the courses, you can get some machine learning as well from lectures on programming a self driving car at udacity and implement them at hackerrank.
评论 #7481673 未加载
helgefmiabout 11 years ago
The score of a game is very much dependent on luck, though.. I&#x27;ve made an AI bot (<a href="https://github.com/helgefmi/c2048" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;helgefmi&#x2F;c2048</a>) that averages on ~50k score, but its highscore is ~220k. Sometimes it gets 13k. So to get a good score (or your best score) on hackerrank.com, you&#x27;d need to resubmit 500 times. At least with the algorithms that I use.
评论 #7482519 未加载
sixothreeabout 11 years ago
In 2048 a player move that causes no actions on the board will not cause a new tile to be created. It seems at first glance this is not the case here.
naruilabout 11 years ago
I&#x27;m just thinking that if the game do not stop at 2048 it will be much more challenging, as reaching 2048 is a relatively easy task for AI.