Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: March Madness for Hackers (codersbracket.com)
100 points by nimz on March 17, 2014 | hide | past | favorite | 59 comments



Hey - David from Fullstack Academy. Our students this semester decided to build something awesome around learning to code and March Madness and codersbracket.com is the result.

It's March Madness brackets but instead of picking teams, people can write code that will automatically generate their bracket for them. Our students have raised some money and are donating it all to code-learning organizations (CodeNow, Code.org, GirlsWhoCode).


Could you add the last couple years' brackets and stats as an algorithm tester?

Would be cool to run your algorithm against previous years to see how it would have done so you can refine it before submitting.

I'm imagining coloring the final bracket green/red for correctly/incorrectly predicted games in the simulation.


Hey yeldarb, Nimit here from Fullstack. Good idea! We did have the 2013 data up last week before the 2014 bracket came out yesterday but will work on adding more years and the comparison to how the previous brackets turned out!


Any idea if you'll have this functionality up before the bracket deadline ends? I'd love to be able to build out some functions and test them on previous years before the contest officially starts.


Off topic - did you ever play Wizardry?


That would be great.


This is awesome! I went to UConn, so I'll obviously hard-code a UConn win there. But I heard on NPR today that, historically, a 12 seed has a 50% chance of upsetting a 5 seed in the first round. If I'm biasing towards the higher seeds everywhere else, that means my code looks like this:

function (game, team1, team2) {

  var winner_team = "Connecticut";
  
  if (team1.name == winner_team) {
    team1.winsGame();
  } else if (team2.name == winner_team) {
    team2.winsGame();
  } else if (team1.seed > team2.seed) {
    team2.winsGame();
  } else if (team2.seed == "12") {
    team2.winsGame();
  } else {
    team1.winsGame();
  }
            
}


WOuldn't this not take into account 12 seeds winning? Since you do team1.seed > team2.seed before checking if team2.seed is 12.

Also, this would mean 12 seeds would go all the way anyway, you're not limiting it to the first round only.


Yeah, trg2 would need to put all the edge case rules towards the beginning. That, or just put the basic rules at the beginning and have separate conditionals at the end to handle the edge cases.


Good call - thanks for the CR! :)


This is exactly the reason we built this - it's much harder to keep all these various rules in your head while you're making your bracket, but simple to execute in code. Thanks for the awesome example!


Awesome idea... one quick feature suggestion -- on the bracket, itself, it'd might be nice to highlight any upsets (e.g. in bold and/or red or something like that).

Typically, variance in brackets is based on the upsets picked... so by making those more visible, it would make it easier for a human to more quickly digest the content.

Just a thought. But regardless, awesome idea. Well done!


This is really cool and it got even better when I found the documentation. I was hoping there would be a way to access rounds and seeds to try and put some more coding effort into a No.12 vs No.5 first round game.



> Coder's Bracket is the product of an internal open-source project at Fullstack Academy.

so, is there source available?

Regardless, very cool concept and execution.


Hey netcraft - we built this really quickly so the source is a bit messy - we'll work on open-sourcing it sometime in the near future though.


Really cool. A killer feature would be the ability to test against past years tourney's actual results.


We have the last few years of data but we don't have back-testing yet - great idea though!


Sorry if this sounds dumb... but what's a bracket?



This is awesome. Where are the data sources coming from for this? For free throw percentage, etc. I'm assuming this wasn't manually gathered as the teams were just announced yesterday and it'd be a hassle to do it so quickly.


We've scraped the data from various sources - when Selection Sunday was announced we basically edited up a big JSON object to get it ready.


This is a super neat idea. Thanks so much for making it!

Some small comments:

I found the tutorial video painfully slow, but maybe you're targeting beginning programmers. All I was looking for was-- what's the language, what's the api.

The determining function could easily be a pure function. I.e., it could designate the winner by returning true, or false, or an enum/constant.

Actually, I think I would prefer this API:

function (team) { return team.off_reb * team.win_pct; }

And then play the teams by calculating the scores for each team and comparing them. But then of course, you can't have different scores depending on the opponent. I wouldn't use that information, but perhaps others would.


re: your API comment: seems like putting extra functions into the outer context breaks the parser, but putting them inside the main anonymous function worked for me.


I had this idea for multiple years and never finished the project. I started it in Python, then 2 years later re-wrote it in Ruby. Since someone else finally implemented it, you should name it after my project: March Nerdness :)


Would also be cool to be able to include more detailed data. There's some useful data points exposed at http://madness.io including Tempo-free stats and (not advertised) json endpoints, http://madness.io/teams/uaa.json

Full disclosure: I released this site a few weeks ago, mostly as a side project. I submitted to Show HN but it didn't get much traction. Might be of use though.


Nice site. I agree, I'd love to be able to use some of your data points in my algorithm.


There's a few exposed json endpoints for data, the matchup page, team page, and player page.

eg team: http://madness.io/teams/fak.json eg player: http://madness.io/players/1772.json eg matchup: http://madness.io/matchup/dae/vs/oad/1395332100.json


Is there any endpoint for teams.json or would I need to request each individually? Even if it was just the season stats without the game stats it would be useful.


There is not one at this moment. It's quite an expensive request to serve season stats for n teams.


That's what I figured. Good stuff anyway.


Send me an email through the site with your email, and I can give you a json file of the stats. It just wouldn't be practical to keep it up as a reachable endpoint - too costly


Hey Guys!

I just saw this today and got pretty interested. I was interested in implementing a 'weighted' scoring function, but needed a way to save state somehow. I ended up finding a pretty fun solution using the console. It's really fun to play with the weights and see how the bracket changes!

https://github.com/hstove/Coderbracket-Weighted-Scorer


hold on.. there's a developer console somewhere in the webapp? I don't see it and would love to use it. Am I missing something?


The browser console. (in chrome) View -> Developer -> Javascript Console. You can enter commands there, run functions, access variables (in the page's global scope), etc..


This is really great!

I'd be very interested in the data and the code behind the generator function. I'd love to integrate it with my bracket-generator module (which is very basic and only does lower seed, higher seed, and random currently).

https://github.com/tweetyourbracket/bracket-generator


I think games against top 25 teams (and their win percentage of those games) would be a good thing to add as well.


Using this for Buffet's Billion Dollar Bracket Challenge (because no one is going to win that anyways!)


I went to enter my bracket on Yahoo, same as I've done for the last 15 years, and it's demanding to "verify" a mobile number for me, and forcing me to agree to accept marketing txts.

There's no way for me to "verify" a mobile number without agreeing to marketing txts. There's no way for me to create a bracket without "verifying" a mobile number.

Yeah, no.

And thus ends my 15 years of using the site for this, with an angry feeling on my side. Well done, Yahoo.


Use a throw-away GVoice account?


I'm not sure if the 'turnovers'/'turnovers_per_game' is a POSITIVE or a NEGATIVE. Is it that they turn it over that many times? Or they take it away?

I'm assuming it's a negative and it really means that turnovers is how many times they actually turn the ball over.


In basketball a "turnover" is when your team gave up the ball when you didn't have to, and thus is a negative.


Very nice. I've run a marginally similar site for a few years that I had just decided to sunset (http://randombracket.com). Too much work for about four days of usage :)

I'm glad I have your site to use now.


Just as naive but fun to look at:

function(game, team1, team2){

  if (team1.rpi > team2.rpi) {
    team2.winsGame();
  } else {
    team1.winsGame();
  }
}

I want to custom build from a known index via ESPN but don't if the team objects hold all the stats necessary.


Site seems dead for me. Anybody have a tl;dr or cached version?


It's back - our servers got a bit overloaded due to the rush.


Sweet! Thanks for the quick recovery


This is awesome! I took the time to create a pretty in-depth function only to find out you apparently can't do that :(


Hey mmcclure - sorry about that. We don't have any check's against in-depth functions ;) so maybe there's a bug on our side. Can you send me your function at nimit@fullstackacademy.com and I'll get back to you about what may have gone wrong!


This is pretty awesome. Would be rad to have something similar for the world cup for us non us sports loving coders.


This is awesome! Is there a way to go full screen on the editor? I couldn't seem to find one.


Hi debaserab2 - you can Expand Editor under Help right now, but we don't have full-screen editor. Great idea though!


Video audio keep play when pressing Next during video play. Windows/Chrome.


Any functionality to create a pool? That would be great.


Hey - we have Bracket Pools in the nav bar - that should let you invite friends and have them put their brackets against yours.


And we're back - sorry overloaded our servers!


I'm liking the voice of that tutorial video.


This is so cool! What are you using for data?


Very cool idea.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: