Coders Bracket: Write successful tourney code, win $2000 (algorithms and coding and stuff)

Submitted by ProfMurdoc on

https://www.codersbracket.com/code_bracket

 

Write your own algorithm for picking your bracket (or hard coding a Michigan victory). You can pull in all manner of stats and rankings, plus add your own special sauce. 

Has default examples like picking by seed or at random, or increasingly based on seed in later rounds. 

Nothing as silly as picking by SAT scores, but a chance to test your hunches on what is really going to matter. 

 

Based in JS. I figured there was a decent enough programming crowd here to pass it along. Plus, there are actually basic JS lessons there too, if you are both into winning at sports *and* learning marketable skills.

 

EDIT:

Forgot to mention the prizes, the key one being $2000 hard cash for the valiant victor.

Code on.

 

https://www.codersbracket.com/code_bracket

Swayze Howell Sheen

March 18th, 2014 at 4:35 PM ^

this was the key to my code:

if (team1.name === "Michigan") {
      team1.winsGame();
  } else if (team2.name === "Michigan") {
      team2.winsGame();
  } else {
     ...
}
 

joeyb

March 18th, 2014 at 5:45 PM ^

If anyone has an idea for an algorithm that they'd like to see coded, let me know. I'll try to get some done when I have some free time.

ProfMurdoc

March 19th, 2014 at 4:24 AM ^

If there's a way to qantify "resume" (best wins/worst losses), I'm thinking something like maybe kenpom, minus the two best wins & worst losses, weighting more for stats in the last 10 games (and even more for the last 5), with an increasing bias towards highers seeds after each round. 

 

...and also, Michigan always wins. 

GoBlueInIowa

March 18th, 2014 at 6:22 PM ^

Cool site - was playing around with the mix of by seeds and random and it actually put together some realistic looking brackets.

Someone should reverse engineer the code after the tourney to see what it would have taken to get a perfect bracket (other than the one that I already entered - going to be nice being a billionaire, will be able to afford water at football games for the whole family)

JamieH

March 19th, 2014 at 12:30 AM ^

a bracket generator back in the pre-internet days when getting info on this stuff was tough.  It used a combo of the Sagarin rankings (which were about the only up-to-date rankings you could get via newspaper) and historical seed information that I generated personally by digging through all the tournament results since the field went to 64 teams in 1984.  I used it to enter office pool contests and eventually the online tournament pools for about 10 years.  In all those years I don't think I beat it with my own personal entry even once.  I only wish I had the KenPom stuff to play with back then.

joeyb

March 19th, 2014 at 9:52 AM ^

function (game, team1, team2) {
  var team1orebpg = team1.off_reb / team1.games_played;
  var team2orebpg = team2.off_reb / team2.games_played;
  var team1possessions = 66 - team1.turnovers_per_game - team2.steals_per_game - team2.blocks_per_game + team1orebpg;
  var team2possessions = 66 - team2.turnovers_per_game - team1.steals_per_game - team1.blocks_per_game + team2orebpg;
  var team1points = team1.threes_made * 3 + (team1.field_goals_made - team1.threes_made) * 2 + team1.free_throws_made;
  var team2points = team2.threes_made * 3 + (team2.field_goals_made - team2.threes_made) * 2 + team2.free_throws_made;
  var team1ppg = team1points / team1.games_played;
  var team2ppg = team2points / team2.games_played;
  var team1score = team1possessions * team1ppg/66;
  var team2score = team2possessions * team2ppg/66;
  if (team1score * team1.rpi * ((68-team1.seed)/68) >= team2score * team2.rpi - ((68-team2.seed)/68)) {
    team1.winsGame();
  } else {
    team2.winsGame();
  }
            
}