News for hackers. Stuff that matters.
Re:HackerRank aims to build a fun place for programmers to h... by whichdan on Friday June 29, 2012 @03:01PM (#4178425)
The game worked fine for me, just double check "challenge 1" since it asks for a range between "1 and 0"

A few observations:

- If you start <= 6, you will always lose, since you have to choose 1 less than the starting number.

- Whoever gets 6 on their turn will always lose.

- If you start between 7 and 11, you'll always win.

- If you start at 12 or higher, you'll usually lose, since the computer will try to get you to 6.

Still fun for a few minutes atleast. No idea how people are winning 20+ games.

Re:HackerRank aims to build a fun place for programmers to h... by jaredsohn on Friday June 29, 2012 @04:11PM (#4178803)
>No idea how people are winning 20+ games.

I won over 20 games by just spending a few minutes manually running the algorithm described elsewhere here and I imagine anyone who hasn't won hundreds or thousands of games probably did the same. (If you're going to write a bot, might as well let it run for awhile and see if you can max out the leaderboard.)

Re:HackerRank aims to build a fun place for programmers to h... by learc83 on Friday June 29, 2012 @04:16PM (#4178826)
All you have to do is hand the computer a number that is divisible by 6 each time.

If you start with 61 pick one and the computer has 60, say it picks 4 and you have 56 pick 2 so you hand it 54. Repeat until you win.

Re:HackerRank aims to build a fun place for programmers to h... by drewfrank on Friday June 29, 2012 @03:54PM (#4178707)
> If you start at 12 or higher, you'll usually lose, since the computer will try to get you to 6.

Ah, but you can also try to get the computer to 6 ;).

Re:HackerRank aims to build a fun place for programmers to h... by rvivek on Friday June 29, 2012 @03:24PM (#4178562)
Some of them write a 'script' ;)