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.
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 signed up, but it didn't appear to accept my password, presumably to the aforementioned JS bug, but trying to sign up again afterword tells me that my email is taken and won't log me in.
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.
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)?
Hi Ayla, we want to build something that has fun stuff catering to different set of programmers (hackers/programming contest enthusiasts/functional programmers, etc.) Whether it's for pride or for learning new things, we want to leave it to the user.
I agree, as someone that's still just getting my toes wet, as soon as I saw the leaderboard aspect I was like "Ah, this isn't going to be my type of place.."
Was able to sign up, but the challenge totally failed on me.
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.
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 and -1? Any number entered just results in the same "Please provide a number between 1 or -1".
Did you not test this at all before promoting it? I am brand new to programming and even I know that testing is important.
The error is when the argument to the `challenge` command is anything other than a number. Try `challenge monkey`. It then accepts zero for N, and the computer always picks a positive number.
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.)
* 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.
Also spoiler 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.
1. If number is divisible by 6, do not play since you'll always lose.
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.
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.
Getting to the top of the leaderboard is dependent on understanding this and how much time you're willing to spend playing.
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.
I was about to post this exact thing. Its easy enough to figure out if you watch the computer play. Using this its possible to win every single game as long as the number you start with isn't divisible by 6.
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.
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.
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 :)
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.
---------
403 Forbidden
This Web site is blocked: http://hackerrank.com/
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.
I'd say that's probably a good thing considering the passwords were being transmitted in the clear[1]. To me this would seem a huge liability to be accessible by bank employees.
imho the reason is the name. If news.ycombinator.com was called hackernews.com, it would be blocked in 15 seconds flat. That's corporate america for you.
hey passwords are being sent plaintext (https://gist.github.com/3020091/). be careful if you signup/when you log in. use a password you don't care about, or use a throwaway.
I was working on scripting this because there's an easy algorithm to win, but the parsing out the CSRF token to make it work? You should have made it a bit less hurdle-y to script.
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.
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?:
At this point, I get stuck in a loop that I've only been able to get out of with f5.
Well, I was trying to avoid spoilers, but since jaredsohn has already sailed that boat out to sea...
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 except the one that mattered!
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).
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.
If you look at the JavaScript, you can see that it actually expects a keystroke for the Enter key.
I'm not familiar with sending keystrokes in JavaScript (from some brief searching I think it is possible; I just don't know the best practice), but for something like this, you could just do it at the operating system level. A long time ago I automated an annoying user interface for a program we had to use at work by writing some vbscript that changes windows and does a combination of sendkeys and sleep.
Unfortunately, just sending keystrokes isn't very robust since it isn't reading what is going on in the UI and if something random happens (the site behaves other than expected, you touch a key / move the mouse, a scheduled program runs, etc) the script could get out of sync. Fortunately, the consequences of an error are so low here that such a solution would be good enough.
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. http://paste.ubuntu.com/1067434/
I mean come on, mathematical miscalculation for a game like this?
58 comments
[ 3.5 ms ] story [ 137 ms ] threadHope this will be fix soon, cool idea
Is there a login link I can visit?
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)?
TypeError: Cannot call method 'toLowerCase' of undefined [http://www.hackerrank.com/assets/application-18e8ea124a72677...]
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.
Did you not test this at all before promoting it? I am brand new to programming and even I know that testing is important.
Resulting in a negative.
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.
Ah, but you can also try to get the computer to 6 ;).
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.)
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.
* 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.
Also spoiler 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.
1. If number is divisible by 6, do not play since you'll always lose.
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.
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.
Getting to the top of the leaderboard is dependent on understanding this and how much time you're willing to spend playing.
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.
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.
...That is, unless that's the entire point?
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.
--------- 403 Forbidden
This Web site is blocked: http://hackerrank.com/ 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.
This Web site is categorized as Games. ---------
[1]https://gist.github.com/3020091/
but I can't believe I just spent 20 minutes trying to come up with a scripted solution. Nerd sniped again!
http://xkcd.com/356/
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 except the one that mattered!
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).
(see http://postimage.org/image/c3xkrg8y3/ )
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.
I'm not familiar with sending keystrokes in JavaScript (from some brief searching I think it is possible; I just don't know the best practice), but for something like this, you could just do it at the operating system level. A long time ago I automated an annoying user interface for a program we had to use at work by writing some vbscript that changes windows and does a combination of sendkeys and sleep.
Unfortunately, just sending keystrokes isn't very robust since it isn't reading what is going on in the UI and if something random happens (the site behaves other than expected, you touch a key / move the mouse, a scheduled program runs, etc) the script could get out of sync. Fortunately, the consequences of an error are so low here that such a solution would be good enough.