A few things:<p>* I'm having issues with the terminal where what I type is not always on the bottom line. Also, the up/down arrows for getting command history don't always show what I would expect and I get latency fairly frequently.<p>Also <i>spoiler</i> here's an algorithm that will let you win every time where it is possible to win. I debated a bit about posting this, but if I didn't I'm sure somebody else would.<p>1. If number is divisible by 6, do not play since you'll always lose.<p>2. If the number is less than 6, do not play since it doesn't allow you to take them all in the first move, despite what the instructions suggest.<p>3. Otherwise, your first pick should be a number that takes the remaining number to a multiple of six (see rule #1). Then, you should look at what number the computer picks and subtract it from six when you pick your number.<p>Getting to the top of the leaderboard is dependent on understanding this and how much time you're willing to spend playing.<p>Or you could write a bot that plays the game for you. Then getting to the top of the leaderboard depends on who started their bot first and the quality of bots' network connections.
Was able to sign up, but the challenge totally failed on me.<p>First it seemed to not be taking any input, and let me enter about 10 different numbers without response. Then, it showed me the back and forth between me and the computer for about half of those numbers, but the total never changed after that.
The game worked fine for me, just double check "challenge 1" since it asks for a range between "1 and 0"<p>A few observations:<p>- If you start <= 6, you will always lose, since you have to choose 1 less than the starting number.<p>- Whoever gets 6 on their turn will always lose.<p>- If you start between 7 and 11, you'll always win.<p>- If you start at 12 or higher, you'll usually lose, since the computer will try to get you to 6.<p>Still fun for a few minutes atleast. No idea how people are winning 20+ games.
The CLI seems to get into an inconsistent state easily in Chrome, only fixed by reloading the page. I'm sure I know how to win the candy challenge based on the english description of the rules, but I can't make any sense of the output.<p><pre><code> recursive@hackerrank:~$ challenge 1
Playing a game for N: 1
Please provide a number between 1 or 0.
How many candies you want to pick?:
</code></pre>
At this point, I get stuck in a loop that I've only been able to get out of with f5.
I am a novice programmer and I am always put off websites that rank users (and programming competitions for that matter). Avoiding the competition seems better than putting my relatively crappy code out there for all to see.<p>Would more seasoned people out there agree that a clean slate is better than a low ranking on sites like InterviewStreet (or HackerRank if it gets big)?
Well, I was trying to avoid spoilers, but since jaredsohn has already sailed that boat out to sea...<p>How do you script something like this? I tried looking at the source and then using the chrome console to input jQuery commands, but something really weird happened. I could replace just about any element on the screen <i>except the one that mattered</i>!<p>I could type "challenge 8" into the console and then running a $('tester').text() would return "challenge 8" as expected. But $('tester').text('challenge 9') wouldn't update the screen. I tried for a good hour to find a way to update the text in that element, with no luck (short of removing the whole thing from the dom).<p>(see <a href="http://postimage.org/image/c3xkrg8y3/" rel="nofollow">http://postimage.org/image/c3xkrg8y3/</a> )<p>Also how do you send a carriage return? Inserting a newline didn't seem to do the trick. Anyone? As much as I love a challenge, beating my head against this one issue doesn't yield much education / time spent.
Vivek,
Cannot access at the bank.
Contacted friends at other banks. Same story :(
So some 1 million plus corporate programmers don't have access to your website. Here's the message I get on Internet Explorer.<p>---------
403 Forbidden<p>This Web site is blocked: <a href="http://hackerrank.com/" rel="nofollow">http://hackerrank.com/</a>
As part of our ongoing effort to protect the bank and its information, the Web site you are trying to reach is blocked because it is classified in a category the bank considers to have certain risks. The bank blocks access to a number of Web site classifications including but not limited to Web mail sites, Personal Network Storage, and other categories to comply with regulations, protect customer and company information, and to be consistent with industry standards and practices.<p>This Web site is categorized as Games.
---------
Am I missing something? I type signup myemail myusername and I am then prompted for a password which seems to refuse any input or at least not alert me of submission.
I am a very novice programmer, but this challenge seems impossible. It asks "Please provide a number between 1 or -1". That isn't even English. Do you mean between 1 <i>and</i> -1? Any number entered just results in the same "Please provide a number between 1 or -1".<p>Did you not test this at all before promoting it? I am brand new to programming and even I know that testing is important.
I most certainly enjoyed that!
Was nice to find the apply command after poking around in the help.<p><pre><code> == apply: Apply to join our awesome team.
Usage: apply <a profile url> <why do you want to apply>
</code></pre>
Does it have anything to do with my mad skillz in solving the puzzle perhaps? ;-)
This looks cool. But I'm getting a javascript error when trying to sign up.<p>TypeError: Cannot call method 'toLowerCase' of undefined [<a href="http://www.hackerrank.com/assets/application-18e8ea124a726771ae0f901e4094ee4f.js:16" rel="nofollow">http://www.hackerrank.com/assets/application-18e8ea124a72677...</a>]
And just found a bug. I started from 2000 and it got stuck at 378. It is miscalculating and thus going into an infinite loop. <a href="http://paste.ubuntu.com/1067434/" rel="nofollow">http://paste.ubuntu.com/1067434/</a>
I mean come on, mathematical miscalculation for a game like this?
The algorithm is obviously pretty easy, as has been demonstrated...<p>but I can't believe I just spent 20 minutes trying to come up with a scripted solution. Nerd sniped again!<p><a href="http://xkcd.com/356/" rel="nofollow">http://xkcd.com/356/</a>
So maybe I just fail, but I attempted to sign up, typed in the command and then it asked for a password. I assumed this was to make up a password, so I tried that, and it didn't let me enter. Is this a you have to know a password to sign up thing?
I'm going crazy or should I not have won here?<p>Playing a game for N: 10
Your move: '4'. Computer's move: '1'. Remaining candies: '5'
Please provide a number between 1 or 5.
Your move: '5'. Computer's move: '5'.
Sorry! You lost the game.
hey passwords are being sent plaintext (<a href="https://gist.github.com/3020091/" rel="nofollow">https://gist.github.com/3020091/</a>). be careful if you signup/when you log in. use a password you don't care about, or use a throwaway.
Ha! I attempted this yesterday, after I saw the article in TC. It was a really fun challenge! Good job guys! Hope I didn't cost you a lot of money.. by my estimates i sent you something close to like a million requests .. give or take.
You guys rock !!!<p>I also write new bot by python for hackerrank challenge.
Check out my code at <a href="https://github.com/kiennt/hackerrank-bot" rel="nofollow">https://github.com/kiennt/hackerrank-bot</a><p>Happy hacking :)
There's a bug. The cursor sometimes shows up above the current prompt line and I'm not able to type. Clicking on the prompt will just bring it back for a second and then it goes up again.
$ Playing a game for N: 8
$ Your move: '2'. Computer's move: '2'. Remaining candies: '4'
$ Congrats! You won the game. Now go ahead and play for more candies. Enjoy :)
I must say, this 'challenge' is a creative idea.<p>However, not to be a wet blanket, but it's rather simple to construct a winning algorithm, particularly if you can both choose the same starting number and always go first (and choose the same starting number multiple times). If I had a few extra minutes at work right now, I'd take a stab at it.<p>...That is, unless that's the entire point?