Created
April 17, 2014 18:18
-
-
Save jbueza/11002634 to your computer and use it in GitHub Desktop.
Calculate number of rounds in a losers bracket (double elimination)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Math.ceil( (Math.log(teams)/Math.log(2)) / Math.log(2)) / Math.log(2)) + Math.ceil(Math.log(teams)/Math.log(2)) | |
var teams = 128; | |
var initialRounds = Math.ceil(Math.log(teams)/Math.log(2)); | |
var surplus = Math.ceil( Math.log(initialRounds)/Math.log(2) ); | |
console.log(initialRounds); | |
console.log(surplus); | |
console.log("Total Rounds in Losers Bracket: " + initialRounds + surplus); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment