
Code a 2048 bot on hackerrank - rvivek
https://www.hackerrank.com/contests/2048-game/challenges/2048
======
NoodleIncident
The described challenge looks like it's different from the actual game in
important ways.

Obviously there's the different chances for a 2 vs a 4 (used to be 10%, here
it's 25%). More importantly, though, it seems that you don't have to slide any
tiles for new ones to be spawned.

I'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't want to, because
all of the other directions didn't move tiles and thus didn't generate a new
one. Without this, the game seems like it would be a lot easier.

~~~
khongor
Hello NoodleIncident,

More importantly, though, it seems that you don't have to slide any tiles for
new ones to be spawned.

We had two reasons for this modification. 1) We wanted random bot that prints
one of the 4 moves randomly to be able to play longer 2) In the original game,
if your move does not slide anything you will not lose (infinite loop) :). So
we wanted a new tile appears after every move (not matter what the move is).

------
bargl
I love hackerrank and checkio. Both are great platforms. I wish that they
would integrate with Coursera/udacity so that I could solve the programming
challenges in one of these mediums and at the same time get guidance from a
lecture.

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.

~~~
rvivek
Thanks bargl. We are working on it. Hopefully you'll get to hear some good
news soon.

------
helgefmi
The score of a game is very much dependent on luck, though.. I've made an AI
bot ([https://github.com/helgefmi/c2048](https://github.com/helgefmi/c2048))
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'd need
to resubmit 500 times. At least with the algorithms that I use.

~~~
helgefmi
Also, I think it might be buggy, or am I just not getting your UI? Each of my
10 submissions have one lost game and one won game. The lost games are lost on
move #1, while the other game always wins. I first thought that it had to do
with the AI spending too much time, but it seems improbable that I'd get the
same result 10 times in a row. Username is helgefmi.

------
sixothree
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.

------
naruil
I'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.

