Settings

Theme

Codefights

codefights.com

154 points by r_ms 11 years ago · 85 comments

Reader

columbo 11 years ago

I think you should show the comments first without a time-limit and then allow the user to play. For example:

        /*
         * @Input1: an integer
         * @Input2: an integer (@Input1 <= @Input2)
         * @Input3: an integer (@Input3 !== 0)
         * @Output: maximal integer from @Input1 to @Input2 inclusive
         * which is divisible by @Input3
         * or -1 if there in no such number
         */
<insert click to play button>

Right now it takes me 20-30 seconds just to read and understand the comments.

  • pavel_lishin 11 years ago

    Why should reading the code be timed, but reading comments not timed?

    • laumars 11 years ago

      Because this is a test of ones ability to code; not the speed at which they can read English.

      As I said earlier: https://news.ycombinator.com/item?id=8207116

    • pyre 11 years ago

      Reading the comments is about understanding what the function is supposed to be doing. Reading the code is about actually finding the bug. I can see the argument for allowing one to understand the problem prior to hunting down the bug.

      • squeaky-clean 11 years ago

        While I understand point people are making, I think understanding the problem is part of the debugging process, and should be a part of the puzzle and timer.

        I remember entering programming competitions in high school and college. The first 5 minutes, when everyone is ripping open the envelope of their problem packet and trying to find the easiest problems was always very intense, and fun! Sometimes you would read through it too quickly, and miss a small detail that would render all the code you wrote completely useless. That's part of the challenge!

        • Huppie 11 years ago

          The difference in high school IMHO is that I give it a big chance that everybody was a native English speaker there.

          I agree with you that understanding the (full) problem is part of the challenge in some cases, but since the headline here is 'How fast can you debug?' it has to test debugging skill.

          I'm lucky to read and write English about every single day but have colleagues who are probably faster than me at debugging code that will take a lot longer because they'll first have to carefully read and translate the specification before they could continue.

        • pyre 11 years ago

          I can definitely see both arguments. I think that they both have merits, and it's just a difference of opinion. :)

tsholmes 11 years ago

One suggestion for the founders, don't start the timer until the code has loaded, and stop the timer once you submit. I lost 10-15 seconds to loading the code and then got game over because i submitted with 10 seconds left and it took longer than that to actually send.

  • wpaprocki 11 years ago

    Let's see how quickly they can fix that bug...

  • 0x0 11 years ago

    Yeah.. I got the task when the timer had 0:20 left, fixed it in 2 seconds, hit submit, it said "submitting..." until the timer ran down to 0:00 and then just "Game over". :-/

  • Tiks 11 years ago

    Yeap, great point. We currently sync the time with the server regularly to avoid cheating and given that the servers are under HN rush right now the delay is probably way more significant than it usually is. However, we are trying to figure out a better way to do this to make sure it doesn't start counting before the task loads.

    • laumars 11 years ago

      Could you also start the timer after the player has acknowledged they've read the problem? At the moment you're unfairly disqualifying players who have reading difficulties (English isn't their first language, reading difficulties like dyslexia, or even those with partial eyesight so also read slower).

      Timing the person's ability to read English doesn't prove their ability to write Javascript et al.

      • pavel_lishin 11 years ago

        Won't people with dyslexia and poor eyesight have trouble reading the code as well?

        • laumars 11 years ago

          Not with dyslexia, no. Because the problem lies with the syntax and semantics of the language and since programming languages are logic based rather than evolved from grunts with complex non-obvious rules, many people with learning difficulties (including myself) find it massively easier to parse code than English.

          To use myself as an example, it took me around 30 seconds just to read and understand the first challenge, yet I was able to solve it in around 10 seconds after that despite it being a Javascript language (which is probably the weakest of the dozen or so languages I code in). If I was to go head to head with someone, that 30 second read time would be a hell of a handicap.

          As for poorer eyesight, yes you'd have a point there, but at least the playing field would be levelled out a little more.

          • pavel_lishin 11 years ago

            Interesting, I did not know that. I thought most of the problems with dyslexia came from actually being able to read series of letters and numbers - I've heard it described as letters coming together in a jumble, and not in actual order that they appear in a word

            • laumars 11 years ago

              That can be an issue in more severe cases, but even in those instances most programming languages aren't too verbose in their syntax that you cannot understand the logic process. Plus indentation obviously helps a lot there too.

  • sbouafif 11 years ago

    Same thing for me. Start the timer when the code is loaded and stop the timer when the user pressed Ctrl+Enter.

    One other suggestion is to add Cmd+Enter for mac user.

  • prof_hobart 11 years ago

    Definitely an issue - I spent around 5 seconds between the code appearing and pressing the submit button, yet I ran out of time.

Tiks 11 years ago

Hi guys, co-founder of codefights here, the site is still in beta and someone posting it to HN caught us totally off guard. Migrating the servers now to something that can handle this traffic. Appreciate the patience :)

EDIT: OK Servers migrated but it still can't come close to handling HN rush levels. While that's passing I can explain the main concept here.

A task on codefights is a function written in javascript that has 1 bug on 1 line of it and your goal is to find and fix it as soon as you can. There is a Solo mode and a VS Friend mode. In the Solo mode you start with easy tasks and need to find the bug in under a minute, if you do, you go to the next rounds where the tasks progressively get harder.

In the VS Friend mode, you codefight someone else where you guys have 5 rounds facing the same task in each round and each correct solution is 100 points, pass is 0 points and an incorrect answer is -25. At the end of 5 rounds whoever gets more points wins.

Please let me know if anyone has any questions or feedback. Hope you guys will get to try it for real soon :).

migstopheles 11 years ago

Maybe I'm just showing my low IQ, but it takes me 20 or 30 seconds just to understand some of the problems. Maybe introduce difficulty levels? Currently, I can't ever solve a problem if it takes me more than 1 minute - I'd like to be able to get to an answer, even if it's then worth zero points (or even goes into negative points?).

I like the idea, but I can't play more than 2 or 3 rounds. Or maybe the game just isn't aimed for people like me...

  • mbenjaminsmith 11 years ago

    FWIW, I have a high IQ and I didn't get very far either. Debugging code I've never seen before in less than 60 seconds isn't a skill I've needed to acquire.

  • pbhjpbhj 11 years ago

    I tried, I'm not a coder, submitted 2 of 3 solutions but just got "game over" back. Would be nice to see a solution, even better with explanation.

    Definitely felt like I was being secretly profiled for a job. Also considered the possibility that if you're good they drop in some segments of code found automatically to have bugs and have you fix them for free ;0)

    • jrochkind1 11 years ago

      Dude, if you win it, the aliens come and take you away to hack in space. They've got some bugs that, if not solved, and quickly, could mean the end of galactic civilization.

  • yogo 11 years ago

    That should be a good thing, understanding what you are about to fix should be most important. I don't think rushed fixes pan out too well in the real world.

  • waterside81 11 years ago

    I think the font size has something to do with it. Maybe the description should be in bigger font outside the code block?

louhike 11 years ago

I cannot connect with my Google account because I have an accent in my first name. And I cannot create an account with just my email (it sais "user not found")

  • kenny_r 11 years ago

    I just gave up trying to connect it to Google or Twitter since those don't work. I ended up using the email signup option but neither signing up nor logging in happen over HTTPS.

    That's why authentication through reliable big services like Google is a thing guys. At least they get it right.

  • harryf 11 years ago

    And why no "Sign-in with Github" ?

    • duiker101 11 years ago

      How about just make it work?

      • 67726e 11 years ago

        Seriously. I just get a blank Google+ popup after authenticating. When I close the dialog it says it couldn't authenticate. Oh well. Looked like a cool idea.

        • _lce0 11 years ago

          same here.. I even tried using my valid email and all I got was "email is invalid"

cfontes 11 years ago

It doesn't load at all for me... HN effect i guess.

But the idea looks like a very nice time waster or argument resolver.

I have a co-worker that always has the best theoretical cafe solution to every single bug ever found on any computer program, on this and parallel universes.

Would be nice to play this against him and maybe win one or 2.

Edit:

Looking at the bright side.

Most people that up voted the site liked the idea even without seeing the product working( I did).

That alone is a nice thing to have. So if you make it work you will get double XP!

  • Tiks 11 years ago

    Hehe, never thought of it as an argument resolver but that's a cool idea. One other idea that I have already tried quite successfully was to use this as a technical phone screen tool where you codefight the candidate or ask them to do a few solo modes to see how far they get :)

    • laumars 11 years ago

      > One other idea that I have already tried quite successfully was to use this as a technical phone screen tool where you codefight the candidate or ask them to do a few solo modes to see how far they get

      Sorry, but that's a terrible idea. As a bit of recreational fun, this game is fine for. But judging candidates on their ability to speed read would exclude a lot of very capable developers (as well as potentially land you into trouble under equal opportunity employment laws given the aforementioned bias this games introduces)

jrochkind1 11 years ago

Interesting idea.

Several of the solutions I encountered are just... plain done wrong. They have a bug, sure, but the bug's actually there cause it was written in a really hacky way instead of the simplest way that would implement the function.

I feel like it took me longer to find the bug in the hacky implementation than it would have to rewrite it 'right'.

(For instance, the 'right' way to find "largest integer with x number of digits" is clearly and inarguably `Math.pow(10, x) - 1`. Not the hacky 4-line-with-for-loop thing they showed me with a bug in it. No?)

I wonder if it would be interesting to have something like this run your solution through a simple test suite to see if it works (like my university professors used to do on our homework), instead of accepting only one exact right answer.

  • blatherard 11 years ago

    This reminds me of more than one job interview I've had. One included a puzzler that was "fix this horribly convoluted javascript code by adding exactly four characters." I'd consider myself a pretty good bug finder-and-fixer. As in, I've read multiple books on debugging methods and even given some talks on effective debugging. Nevertheless, these kinds of stumpers make me freeze up.

    I dunno exactly what puzzles like these demonstrate. That you spend a lot of time working in poorly written code?

    • Too 11 years ago

      I've actually seen this mentality on production code. "The smaller the diff the better. And The less we change the less likely we are to introduce new bugs!!1".

danielsamuels 11 years ago

The example on the homepage started a countdown from 1 minute, it was "Loading the task" until there were 7 seconds left, then by that time I'd lost interested and it just said "Game Over".

Game over indeed.

  • Tiks 11 years ago

    Hey Daniel, very sorry about that, HN rush hit our unprepared servers :) Just added several new servers so please try again.

woutervdb 11 years ago

Liking the idea, too bad it's simply an awful experience with all the HN traffic. I hit "Sign up with Facebook", then "Edit what CodeFights can see", and the counter had already begun. After authenticating I got an empty pop-up which I closed by myself, and I finished the challenge. I then got the error "Authentication error".

However, I like the idea and understand that this experience is not what you've made so I'll give it a chance and upvoted it.

  • Tiks 11 years ago

    thanks for understanding woutervdb and for the upvote, would be awesome if you can give it a try now (the HN traffic has calmed down :) ) and let us know what you think -- email info @ codefights.com

GotAnyMegadeth 11 years ago

It should show you the correct answer if you get it wrong.

vankap 11 years ago

This is very nice. More engrossing than most games I play. Instead of starting over every time I lose, I would prefer if I was penalized and allowed to continue playing. For instance, if I lose round 5, then I will also lose all the points from round 4 and continue playing from round 4 instead. It's just something that I thought would make it more interesting and playable for me.

anonaut 11 years ago

Seems really nice, but coul'd you add a solution if you fail in time? would be really awesome

hfsktr 11 years ago

From all the comments here I was expecting it wouldn't work at all without signing in somehow. Luckily that wasn't true and the site didn't seem slow at all so I got to actually try it.

I did like it but really wish there was an explanation at the end with the solution (or a solution). Since I don't know what is wrong I don't even know what to search for.

I am not sure if you have categories for the types of problems but dividing them into syntax/logic/easy/difficult/etc and showing your score on those or even compared to others (this might be what signing in does for you but I didn't do that).

I am sure I sound negative but I was impressed. Especially as it's still in progress.

DavidxD 11 years ago

Great idea but sadly I cant try it out :( Using Firefox on Android and the stock Browser I was finally able to login using g+ but I can't edit the code. I can add something but I can't delete anything that was already there. E.g. I can't change return a to return b. Using chrome I can't even login. Authenticate using g+ sometimes directly shows authorization failed and sometimes opens a new tab to codefights.com/_oauth/google?state=xyz&code=xyz that seems to do nothing. If I close it, I get authorization failed as before. Everything I currently do is done on Android 4.4.4 because I just have a smartphone (N5) available ATM.

ozh 11 years ago

I would love if HN had a "Save" button -- save an item into a personal list so I can, for instance, retry a link later after the HN effect has stopped...

  • pbhjpbhj 11 years ago

    Browser bookmarks?

    I have a pile of "to do" "to read" "business idea" tags that I never get around to looking at ...

  • Lewton 11 years ago

    Upvote the link, it will get saved under your profile "saved stories"

    • ozh 11 years ago

      Yeah I know that but alas this isn't "Saved stories", this is barely "Random mess of stuff I've liked, stuff I wanted to keep an eye on and stuff I wanted to look at later"

rory096 11 years ago

/ * @Input1: an array of strings * @Input2: a separator that will be used when concatinating * the strings from @Input1 * @Output: a concatinated string * @Example: myConcat(["Code","Fight","On","!"],"/")="Code/Fight/On/!/" */

Guess s/concatinated/concatenated/g wasn't the bug...

codecondo 11 years ago

Is it anything like code challenges? I might add it to this list: http://codecondo.com/coding-challenges/

  • alokdhari 11 years ago

    I am not at all sure about codeFights but tell you what.. the links on the page you mentioned are really good. I didn't know about a few of them and will definitely check them out. Thanks

andrewchoi 11 years ago

After I fail a challenge, the screen disappears too quickly for me to continue looking at the challenge and figure out the correct solution. Is there a way to enable feedback or solutions?

  • Tiks 11 years ago

    there is actually a workaround right now (not a great one but still). If you go to Forum from the top nav bar then click tasks you can see all of the tasks that you ever got during your codefights.

qzcx 11 years ago

I love the idea. It still needs more problems though. I kept hitting the regEx problem and failing because I've never done regEx in JavaScript. So adding more problems would be nice.

kyberias 11 years ago

I think I'm fairly fast at debugging but these were way, way too hard with the strict time limit. It takes a lot of time to read the problems and the quality of the problems is poor.

pavel_lishin 11 years ago

Ghostery blocks something that seems to break the site altogether: http://i.imgur.com/hTkLTqd.png

druska 11 years ago

I don't like how I can't change the number of lines of code. It'd be faster to completely rewrite some of the solutions!

imslavko 11 years ago

Great to see CodeFights being launched! I enjoyed the graphics and dynamics of MathFights.com as well, well done, Tigran and the team.

niels_olson 11 years ago

Here's the problem: this is so awesome I forgot to come back and upvote until it was almost off the front page. THIS IS AWESOME!

ErikRogneby 11 years ago

the Oauth redirect receiver is failing for both Google and Twitter. (http://codefights.com/_oauth/twitter?close&state=*hashed_key...)

hoopism 11 years ago

Twitter authorization doesn't work... unless that's the first round... did I fail?

shangxiao 11 years ago

1/2 the available time was taken waiting for "Loading the task..." !

  • Tiks 11 years ago

    sorry about that, way too many people on the site right now :(

eclipxe 11 years ago

This is a lot of fun - server is a bit laggy/buggy but unique idea, very cool!

danielweber 11 years ago

This is a lot of fun.

Please say which language the problem is in.

Also, many times it seems to hang.

  • Tiks 11 years ago

    everything is in javascript right now

    • danielweber 11 years ago

      How do you verify answers? Say there is more than one correct answer to a solution: do you run the code in a sandbox (with memoization) to find out if it works properly? Or is there only supposed to be exactly one proper answer for each question?

      EDIT You should also provide a "reset" button if I screw up the form.

      EDIT The horizontal scrolling is messed up, Google Chrome 36.0.1985.143 (Official Build 287914) m on Windows. I cannot see the right two or so characters on a wide question.

inoab 11 years ago

This is like a hackathon project I had this year at HackRU.

  • inoab 11 years ago

    I am still working on mine though, who made codefights? I would like to get in contact.

    • 33W 11 years ago

      Sounds like Tiks is on the team that made it, commenting throughout.

joekinley 11 years ago

I couldn't even try it. Waiting to check out tho

kurokikaze 11 years ago

Hug of death?

JSno 11 years ago

is JS the only lang you support?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection