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).
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.
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();
}
}
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.
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.
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.
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.
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.
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
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!
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..
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).
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.
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 :)
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!
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).