Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adds BracketTree::Template w/ Single/Double Elim

  • Loading branch information...
commit 4512c89352b9cba05d3eb2f61e5fb2a57a8a57f9 1 parent 34aa833
@cadwallion cadwallion authored
View
3  lib/bracket_tree.rb
@@ -1,5 +1,8 @@
require 'json'
require 'bracket_tree/bracket'
+require 'bracket_tree/template'
+require 'bracket_tree/templates/double_elimination'
+require 'bracket_tree/templates/single_elimination'
module BracketTree
end
View
1  lib/bracket_tree/bracket.rb
@@ -39,6 +39,7 @@ def add position, data
end
end
+ # This needs refactoring. Inconsistent interface
def add_winner winner
@root.payload.seed_value = winner.seed_position
@root.payload.race = winner.race
View
1  lib/bracket_tree/node.rb
@@ -13,6 +13,7 @@ def method_missing(sym, *args, &block)
def to_h
{
+ position: @position,
payload: @payload,
left: @left ? @left.to_h : nil,
right: @right ? @right.to_h : nil
View
82 lib/bracket_tree/template.rb
@@ -0,0 +1,82 @@
+module BracketTree
+ # Contains the logic for common template formats. Holds match progression as well as seat order to generate the correct bracket tree.
+ module Template
+ class Base
+ class << self
+ # Reads stored JSON files to generate a Template
+ #
+ # @param [Fixnum] size - player count
+ # return [nil, BracketTree::Template] template - the resulting bracket template
+ def by_size size
+ filename = File.join location, "#{size}.json"
+
+ if File.exists? filename
+ from_json JSON.parse File.read filename
+ else
+ return nil
+ end
+ end
+
+ # Generates Template from JSON
+ #
+ # @param [String] json - the bracket template in its standard data specification
+ # @return [BracketTree::Template]
+ def from_json json
+ template = new
+ if json['seats']
+ template.seats = json['seats'].map { |s| s['position'] }
+ end
+
+ if json['startingSeats']
+ template.starting_seats = json['startingSeats']
+ end
+
+ if json['nodes']
+ template.nodes = json['nodes']
+ end
+
+ template
+ end
+
+ # Folder location of the template JSON files. Abstract method
+ # @return [String] location - the folder name of the JSON files
+ def location
+ raise NotImplementedError, 'Abstract method, please define `location` in subclass.'
+ end
+ end
+
+ attr_accessor :seats, :starting_seats, :nodes
+
+ def initialize
+ @seats = []
+ @starting_seats = []
+ @nodes = []
+ end
+
+ # Generates a Bracket object with placeholder empty hashes for each Seat in the
+ # Template
+ #
+ # @return [BracketTree::Bracket] bracket
+ def generate_blank_bracket
+ bracket = Bracket.new
+
+ @seats.each do |position|
+ bracket.add position, {}
+ end
+
+ bracket
+ end
+
+ # Returns hash representation of the Template
+ #
+ # @return [Hash] template
+ def to_h
+ hash = {
+ 'seats' => @seats.map { |s| { 'position' => s } },
+ 'startingSeats' => @starting_seats,
+ 'nodes' => @nodes
+ }
+ end
+ end
+ end
+end
View
13 lib/bracket_tree/templates/double_elimination.rb
@@ -0,0 +1,13 @@
+module BracketTree
+ module Template
+ # Template for double-elimination-based tournament formats. Uses the 'right' half
+ # of the binary tree for the loser's bracket and the 'left' half for the winner's
+ class DoubleElimination < Base
+ class << self
+ def location
+ File.join File.dirname(__FILE__), 'templates', 'double_elimination'
+ end
+ end
+ end
+ end
+end
View
107 lib/bracket_tree/templates/double_elimination/16.json
@@ -0,0 +1,107 @@
+{
+ "nodes":[
+ { "seats":[1,3], "winnerTo":2, "loserTo":39 },
+ { "seats":[5,7], "winnerTo":6, "loserTo":41 },
+ { "seats":[9,11], "winnerTo":10, "loserTo":45 },
+ { "seats":[13,15], "winnerTo":14, "loserTo":47 },
+ { "seats":[17,19], "winnerTo":18, "loserTo":51 },
+ { "seats":[21,23], "winnerTo":22, "loserTo":53 },
+ { "seats":[25,27], "winnerTo":26, "loserTo":57 },
+ { "seats":[29,31], "winnerTo":30, "loserTo":59 },
+
+ { "seats":[2,6], "winnerTo":4, "loserTo":55 },
+ { "seats":[10,14], "winnerTo":12, "loserTo":49 },
+ { "seats":[18,22], "winnerTo":20, "loserTo":43 },
+ { "seats":[26,30], "winnerTo":28, "loserTo":37 },
+ { "seats":[39,41], "winnerTo":40, "loserTo":null },
+ { "seats":[45,47], "winnerTo":46, "loserTo":null },
+ { "seats":[51,53], "winnerTo":52, "loserTo":null },
+ { "seats":[57,59], "winnerTo":58, "loserTo":null },
+
+ { "seats":[4,12], "winnerTo":8, "loserTo":61 },
+ { "seats":[20,28], "winnerTo":24, "loserTo":35 },
+ { "seats":[37,40], "winnerTo":38, "loserTo":null },
+ { "seats":[43,46], "winnerTo":44, "loserTo":null },
+ { "seats":[49,52], "winnerTo":50, "loserTo":null },
+ { "seats":[55,58], "winnerTo":56, "loserTo":null },
+
+ { "seats":[8,24], "winnerTo":16, "loserTo":33 },
+ { "seats":[38,44], "winnerTo":42, "loserTo":null },
+ { "seats":[50,56], "winnerTo":54, "loserTo":null },
+
+
+ { "seats":[35,42], "winnerTo":36, "loserTo":null },
+ { "seats":[54,61], "winnerTo":60, "loserTo":null },
+
+ { "seats":[36,60], "winnerTo":48, "loserTo":null },
+
+ { "seats":[33,48], "winnerTo":34, "loserTo":null },
+
+ { "seats":[16,34], "winnerTo":null, "loserTo":null }
+ ],
+ "seats": [
+ { "position":32 },
+ { "position":16 },
+ { "position":8 },
+ { "position":24 },
+ { "position":4 },
+ { "position":12 },
+ { "position":20 },
+ { "position":28 },
+ { "position":2 },
+ { "position":6 },
+ { "position":10 },
+ { "position":14 },
+ { "position":18 },
+ { "position":22 },
+ { "position":26 },
+ { "position":30 },
+ { "position":1 },
+ { "position":3 },
+ { "position":5 },
+ { "position":7 },
+ { "position":9 },
+ { "position":11 },
+ { "position":13 },
+ { "position":15 },
+ { "position":17 },
+ { "position":19 },
+ { "position":21 },
+ { "position":23 },
+ { "position":25 },
+ { "position":27 },
+ { "position":29 },
+ { "position":31 },
+ { "position":34 },
+ { "position":33 },
+ { "position":48 },
+ { "position":36 },
+ { "position":60 },
+ { "position":35 },
+ { "position":42 },
+ { "position":54 },
+ { "position":61 },
+ { "position":38 },
+ { "position":44 },
+ { "position":50 },
+ { "position":56 },
+ { "position":37 },
+ { "position":40 },
+ { "position":43 },
+ { "position":46 },
+ { "position":49 },
+ { "position":52 },
+ { "position":55 },
+ { "position":58 },
+ { "position":39 },
+ { "position":41 },
+ { "position":45 },
+ { "position":47 },
+ { "position":51 },
+ { "position":53 },
+ { "position":57 },
+ { "position":59 }
+ ],
+ "startingSeats":[1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31]
+}
+
View
202 lib/bracket_tree/templates/double_elimination/32.json
@@ -0,0 +1,202 @@
+{
+ "nodes":[
+ { "seats":[1,3], "winnerTo":2, "loserTo":73 },
+ { "seats":[5,7], "winnerTo":6, "loserTo":75 },
+ { "seats":[9,11], "winnerTo":10, "loserTo":79 },
+ { "seats":[13,15], "winnerTo":14, "loserTo":81 },
+ { "seats":[17,19], "winnerTo":18, "loserTo":87 },
+ { "seats":[21,23], "winnerTo":22, "loserTo":89 },
+ { "seats":[25,27], "winnerTo":26, "loserTo":93 },
+ { "seats":[29,31], "winnerTo":30, "loserTo":95 },
+ { "seats":[33,35], "winnerTo":34, "loserTo":103 },
+ { "seats":[37,39], "winnerTo":38, "loserTo":105 },
+ { "seats":[41,43], "winnerTo":42, "loserTo":109 },
+ { "seats":[45,47], "winnerTo":46, "loserTo":111 },
+ { "seats":[49,51], "winnerTo":50, "loserTo":117 },
+ { "seats":[53,55], "winnerTo":54, "loserTo":119 },
+ { "seats":[57,59], "winnerTo":58, "loserTo":123 },
+ { "seats":[61,63], "winnerTo":62, "loserTo":125 },
+
+ { "seats":[2,6], "winnerTo":4, "loserTo":121 },
+ { "seats":[10,14], "winnerTo":12, "loserTo":115 },
+ { "seats":[18,22], "winnerTo":20, "loserTo":107 },
+ { "seats":[26,30], "winnerTo":28, "loserTo":101 },
+ { "seats":[34,38], "winnerTo":36, "loserTo":91 },
+ { "seats":[42,46], "winnerTo":44, "loserTo":85 },
+ { "seats":[50,54], "winnerTo":52, "loserTo":77 },
+ { "seats":[58,62], "winnerTo":60, "loserTo":71 },
+ { "seats":[73,75], "winnerTo":74, "loserTo":null },
+ { "seats":[79,81], "winnerTo":80, "loserTo":null },
+ { "seats":[87,89], "winnerTo":88, "loserTo":null },
+ { "seats":[93,95], "winnerTo":94, "loserTo":null },
+ { "seats":[103,105], "winnerTo":104, "loserTo":null },
+ { "seats":[109,111], "winnerTo":110, "loserTo":null },
+ { "seats":[117,119], "winnerTo":118, "loserTo":null },
+ { "seats":[123,125], "winnerTo":124, "loserTo":null },
+
+ { "seats":[4,12], "winnerTo":8, "loserTo":69 },
+ { "seats":[20,28], "winnerTo":24, "loserTo":83 },
+ { "seats":[36,44], "winnerTo":40, "loserTo":99 },
+ { "seats":[52,60], "winnerTo":56, "loserTo":113 },
+ { "seats":[71,74], "winnerTo":72, "loserTo":null },
+ { "seats":[77,80], "winnerTo":78, "loserTo":null },
+ { "seats":[85,88], "winnerTo":86, "loserTo":null },
+ { "seats":[91,94], "winnerTo":92, "loserTo":null },
+ { "seats":[101,104], "winnerTo":102, "loserTo":null },
+ { "seats":[107,110], "winnerTo":108, "loserTo":null },
+ { "seats":[115,118], "winnerTo":116, "loserTo":null },
+ { "seats":[121,124], "winnerTo":122, "loserTo":null },
+
+ { "seats":[8,24], "winnerTo":16, "loserTo":97 },
+ { "seats":[40,56], "winnerTo":48, "loserTo":67 },
+ { "seats":[72,78], "winnerTo":76, "loserTo":null },
+ { "seats":[86,92], "winnerTo":90, "loserTo":null },
+ { "seats":[102,108], "winnerTo":106, "loserTo":null },
+ { "seats":[116,122], "winnerTo":120, "loserTo":null },
+
+ { "seats":[69,76], "winnerTo":70, "loserTo":null },
+ { "seats":[83,90], "winnerTo":84, "loserTo":null },
+ { "seats":[99,106], "winnerTo":100, "loserTo":null },
+ { "seats":[113,120], "winnerTo":114, "loserTo":null },
+
+ { "seats":[70,84], "winnerTo":82, "loserTo":null },
+ { "seats":[100,114], "winnerTo":112, "loserTo":null },
+
+ { "seats":[67,82], "winnerTo":68, "loserTo":null },
+ { "seats":[97,112], "winnerTo":98, "loserTo":null },
+
+ { "seats":[68,98], "winnerTo":96, "loserTo":null },
+
+ { "seats":[16,48], "winnerTo":32, "loserTo":65 },
+ { "seats":[65,96], "winnerTo":66, "loserTo":null },
+
+ { "seats":[32,66], "winnerTo":null, "loserTo":null }
+ ],
+ "seats":[
+ { "position": 64 },
+ { "position": 32 },
+ { "position": 66 },
+ { "position": 16 },
+ { "position": 48 },
+ { "position": 65 },
+ { "position": 96 },
+ { "position": 68 },
+ { "position": 98 },
+ { "position": 67 },
+ { "position": 82 },
+ { "position": 97 },
+ { "position": 112 },
+ { "position": 70 },
+ { "position": 84 },
+ { "position": 100 },
+ { "position": 114 },
+ { "position": 69 },
+ { "position": 76 },
+ { "position": 83 },
+ { "position": 90 },
+ { "position": 99 },
+ { "position": 106 },
+ { "position": 113 },
+ { "position": 120 },
+ { "position": 72 },
+ { "position": 78 },
+ { "position": 86 },
+ { "position": 92 },
+ { "position": 102 },
+ { "position": 108 },
+ { "position": 116 },
+ { "position": 122 },
+ { "position": 71 },
+ { "position": 74 },
+ { "position": 77 },
+ { "position": 80 },
+ { "position": 85 },
+ { "position": 88 },
+ { "position": 91 },
+ { "position": 94 },
+ { "position": 101 },
+ { "position": 104 },
+ { "position": 107 },
+ { "position": 110 },
+ { "position": 115 },
+ { "position": 118 },
+ { "position": 121 },
+ { "position": 124 },
+ { "position": 73 },
+ { "position": 75 },
+ { "position": 79 },
+ { "position": 81 },
+ { "position": 87 },
+ { "position": 89 },
+ { "position": 93 },
+ { "position": 95 },
+ { "position": 103 },
+ { "position": 105 },
+ { "position": 109 },
+ { "position": 111 },
+ { "position": 117 },
+ { "position": 119 },
+ { "position": 123 },
+ { "position": 125 },
+ { "position": 8 },
+ { "position": 24 },
+ { "position": 40 },
+ { "position": 56 },
+ { "position": 4 },
+ { "position": 12 },
+ { "position": 20 },
+ { "position": 28 },
+ { "position": 36 },
+ { "position": 44 },
+ { "position": 52 },
+ { "position": 60 },
+ { "position": 2 },
+ { "position": 6 },
+ { "position": 10 },
+ { "position": 14 },
+ { "position": 18 },
+ { "position": 22 },
+ { "position": 26 },
+ { "position": 30 },
+ { "position": 34 },
+ { "position": 38 },
+ { "position": 42 },
+ { "position": 46 },
+ { "position": 50 },
+ { "position": 54 },
+ { "position": 58 },
+ { "position": 62 },
+ { "position": 1 },
+ { "position": 3 },
+ { "position": 5 },
+ { "position": 7 },
+ { "position": 9 },
+ { "position": 11 },
+ { "position": 13 },
+ { "position": 15 },
+ { "position": 17 },
+ { "position": 19 },
+ { "position": 21 },
+ { "position": 23 },
+ { "position": 25 },
+ { "position": 27 },
+ { "position": 29 },
+ { "position": 31 },
+ { "position": 33 },
+ { "position": 35 },
+ { "position": 37 },
+ { "position": 39 },
+ { "position": 41 },
+ { "position": 43 },
+ { "position": 45 },
+ { "position": 47 },
+ { "position": 49 },
+ { "position": 51 },
+ { "position": 53 },
+ { "position": 55 },
+ { "position": 57 },
+ { "position": 59 },
+ { "position": 61 },
+ { "position": 63 }
+ ],
+ "startingSeats":[1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63]}
View
26 lib/bracket_tree/templates/double_elimination/4.json
@@ -0,0 +1,26 @@
+{
+ "nodes":[
+ { "seats":[1,3], "winnerTo":2, "loserTo":11 },
+ { "seats":[5,7], "winnerTo":6, "loserTo":13 },
+ { "seats":[2,6], "winnerTo":4, "loserTo":9 },
+ { "seats":[11,13], "winnerTo":12, "loserTo":null },
+ { "seats":[9,12], "winnerTo":10, "loserTo":null },
+ { "seats":[4,10], "winnerTo":null, "loserTo":null }
+ ],
+ "seats":[
+ { "position": 8 },
+ { "position": 4 },
+ { "position": 10 },
+ { "position": 9 },
+ { "position": 12 },
+ { "position": 11 },
+ { "position": 13 },
+ { "position": 2 },
+ { "position": 6 },
+ { "position": 5 },
+ { "position": 7 },
+ { "position": 1 },
+ { "position": 3 }
+ ],
+ "startingSeats":[1,3,5,7]
+}
View
400 lib/bracket_tree/templates/double_elimination/64.json
@@ -0,0 +1,400 @@
+{
+ "seats": [
+ {"position": 128 },
+ {"position": 64},
+ {"position": 130},
+ {"position": 129},
+ {"position": 192},
+ {"position": 132},
+ {"position": 194},
+ {"position": 131},
+ {"position": 162},
+ {"position": 193},
+ {"position": 224},
+ {"position": 134},
+ {"position": 164},
+ {"position": 196},
+ {"position": 226},
+ {"position": 133},
+ {"position": 148},
+ {"position": 163},
+ {"position": 178},
+ {"position": 195},
+ {"position": 210},
+ {"position": 225},
+ {"position": 240},
+ {"position": 136},
+ {"position": 150},
+ {"position": 166},
+ {"position": 180},
+ {"position": 198},
+ {"position": 212},
+ {"position": 228},
+ {"position": 242},
+ {"position": 135},
+ {"position": 142},
+ {"position": 149},
+ {"position": 156},
+ {"position": 165},
+ {"position": 172},
+ {"position": 179},
+ {"position": 186},
+ {"position": 197},
+ {"position": 204},
+ {"position": 211},
+ {"position": 218},
+ {"position": 227},
+ {"position": 234},
+ {"position": 241},
+ {"position": 248},
+ {"position": 138},
+ {"position": 144},
+ {"position": 152},
+ {"position": 158},
+ {"position": 168},
+ {"position": 174},
+ {"position": 182},
+ {"position": 188},
+ {"position": 200},
+ {"position": 206},
+ {"position": 214},
+ {"position": 220},
+ {"position": 230},
+ {"position": 236},
+ {"position": 244},
+ {"position": 250},
+ {"position": 137},
+ {"position": 140},
+ {"position": 143},
+ {"position": 146},
+ {"position": 151},
+ {"position": 154},
+ {"position": 157},
+ {"position": 160},
+ {"position": 167},
+ {"position": 170},
+ {"position": 173},
+ {"position": 176},
+ {"position": 181},
+ {"position": 184},
+ {"position": 187},
+ {"position": 190},
+ {"position": 199},
+ {"position": 202},
+ {"position": 205},
+ {"position": 208},
+ {"position": 213},
+ {"position": 216},
+ {"position": 219},
+ {"position": 222},
+ {"position": 229},
+ {"position": 232},
+ {"position": 235},
+ {"position": 238},
+ {"position": 243},
+ {"position": 246},
+ {"position": 249},
+ {"position": 252},
+ {"position": 139},
+ {"position": 141},
+ {"position": 145},
+ {"position": 147},
+ {"position": 153},
+ {"position": 155},
+ {"position": 159},
+ {"position": 161},
+ {"position": 169},
+ {"position": 171},
+ {"position": 175},
+ {"position": 177},
+ {"position": 183},
+ {"position": 185},
+ {"position": 189},
+ {"position": 191},
+ {"position": 201},
+ {"position": 203},
+ {"position": 207},
+ {"position": 209},
+ {"position": 215},
+ {"position": 217},
+ {"position": 221},
+ {"position": 223},
+ {"position": 231},
+ {"position": 233},
+ {"position": 237},
+ {"position": 239},
+ {"position": 245},
+ {"position": 247},
+ {"position": 251},
+ {"position": 253},
+ {"position": 32},
+ {"position": 96},
+ {"position": 16},
+ {"position": 48},
+ {"position": 80},
+ {"position": 112},
+ {"position": 8},
+ {"position": 24},
+ {"position": 40},
+ {"position": 56},
+ {"position": 72},
+ {"position": 88},
+ {"position": 104},
+ {"position": 120},
+ {"position": 4},
+ {"position": 12},
+ {"position": 20},
+ {"position": 28},
+ {"position": 36},
+ {"position": 44},
+ {"position": 52},
+ {"position": 60},
+ {"position": 68},
+ {"position": 76},
+ {"position": 84},
+ {"position": 92},
+ {"position": 100},
+ {"position": 108},
+ {"position": 116},
+ {"position": 124},
+ {"position": 2},
+ {"position": 6},
+ {"position": 10},
+ {"position": 14},
+ {"position": 18},
+ {"position": 22},
+ {"position": 26},
+ {"position": 30},
+ {"position": 34},
+ {"position": 38},
+ {"position": 42},
+ {"position": 46},
+ {"position": 50},
+ {"position": 54},
+ {"position": 58},
+ {"position": 62},
+ {"position": 66},
+ {"position": 70},
+ {"position": 74},
+ {"position": 78},
+ {"position": 82},
+ {"position": 86},
+ {"position": 90},
+ {"position": 94},
+ {"position": 98},
+ {"position": 102},
+ {"position": 106},
+ {"position": 110},
+ {"position": 114},
+ {"position": 118},
+ {"position": 122},
+ {"position": 126},
+ {"position": 1},
+ {"position": 3},
+ {"position": 5},
+ {"position": 7},
+ {"position": 9},
+ {"position": 11},
+ {"position": 13},
+ {"position": 15},
+ {"position": 17},
+ {"position": 19},
+ {"position": 21},
+ {"position": 23},
+ {"position": 25},
+ {"position": 27},
+ {"position": 29},
+ {"position": 31},
+ {"position": 33},
+ {"position": 35},
+ {"position": 37},
+ {"position": 39},
+ {"position": 41},
+ {"position": 43},
+ {"position": 45},
+ {"position": 47},
+ {"position": 49},
+ {"position": 51},
+ {"position": 53},
+ {"position": 55},
+ {"position": 57},
+ {"position": 59},
+ {"position": 61},
+ {"position": 63},
+ {"position": 65},
+ {"position": 67},
+ {"position": 69},
+ {"position": 71},
+ {"position": 73},
+ {"position": 75},
+ {"position": 77},
+ {"position": 79},
+ {"position": 81},
+ {"position": 83},
+ {"position": 85},
+ {"position": 87},
+ {"position": 89},
+ {"position": 91},
+ {"position": 93},
+ {"position": 95},
+ {"position": 97},
+ {"position": 99},
+ {"position": 101},
+ {"position": 103},
+ {"position": 105},
+ {"position": 107},
+ {"position": 109},
+ {"position": 111},
+ {"position": 113},
+ {"position": 115},
+ {"position": 117},
+ {"position": 119},
+ {"position": 121},
+ {"position": 123},
+ {"position": 125},
+ {"position": 127}
+ ],
+ "nodes": [
+ {"seats": [1,3],"winnerTo": 2,"loserTo": 139},
+ {"seats": [2,6],"winnerTo": 4,"loserTo": 249},
+ {"seats": [5,7],"winnerTo": 6,"loserTo": 141},
+ {"seats": [4,12],"winnerTo": 8,"loserTo": 135},
+ {"seats": [9,11],"winnerTo": 10,"loserTo": 145},
+ {"seats": [10,14],"winnerTo": 12,"loserTo": 243},
+ {"seats": [13,15],"winnerTo": 14,"loserTo": 147},
+ {"seats": [8,24],"winnerTo": 16,"loserTo": 225},
+ {"seats": [17,19],"winnerTo": 18,"loserTo": 153},
+ {"seats": [18,22],"winnerTo": 20,"loserTo": 235},
+ {"seats": [21,23],"winnerTo": 22,"loserTo": 155},
+ {"seats": [20,28],"winnerTo": 24,"loserTo": 149},
+ {"seats": [25,27],"winnerTo": 26,"loserTo": 159},
+ {"seats": [26,30],"winnerTo": 28,"loserTo": 229},
+ {"seats": [29,31],"winnerTo": 30,"loserTo": 161},
+ {"seats": [16,48],"winnerTo": 32,"loserTo": 131},
+ {"seats": [33,35],"winnerTo": 34,"loserTo": 169},
+ {"seats": [34,38],"winnerTo": 36,"loserTo": 219},
+ {"seats": [37,39],"winnerTo": 38,"loserTo": 171},
+ {"seats": [36,44],"winnerTo": 40,"loserTo": 165},
+ {"seats": [41,43],"winnerTo": 42,"loserTo": 175},
+ {"seats": [42,46],"winnerTo": 44,"loserTo": 213},
+ {"seats": [45,47],"winnerTo": 46,"loserTo": 177},
+ {"seats": [40,56],"winnerTo": 48,"loserTo": 195},
+ {"seats": [49,51],"winnerTo": 50,"loserTo": 183},
+ {"seats": [50,54],"winnerTo": 52,"loserTo": 205},
+ {"seats": [53,55],"winnerTo": 54,"loserTo": 185},
+ {"seats": [52,60],"winnerTo": 56,"loserTo": 179},
+ {"seats": [57,59],"winnerTo": 58,"loserTo": 189},
+ {"seats": [58,62],"winnerTo": 60,"loserTo": 199},
+ {"seats": [61,63],"winnerTo": 62,"loserTo": 191},
+ {"seats": [32,96],"winnerTo": 64,"loserTo": 129},
+ {"seats": [65,67],"winnerTo": 66,"loserTo": 201},
+ {"seats": [66,70],"winnerTo": 68,"loserTo": 187},
+ {"seats": [69,71],"winnerTo": 70,"loserTo": 203},
+ {"seats": [68,76],"winnerTo": 72,"loserTo": 197},
+ {"seats": [73,75],"winnerTo": 74,"loserTo": 207},
+ {"seats": [74,78],"winnerTo": 76,"loserTo": 181},
+ {"seats": [77,79],"winnerTo": 78,"loserTo": 209},
+ {"seats": [72,88],"winnerTo": 80,"loserTo": 163},
+ {"seats": [81,83],"winnerTo": 82,"loserTo": 215},
+ {"seats": [82,86],"winnerTo": 84,"loserTo": 173},
+ {"seats": [85,87],"winnerTo": 86,"loserTo": 217},
+ {"seats": [84,92],"winnerTo": 88,"loserTo": 211},
+ {"seats": [89,91],"winnerTo": 90,"loserTo": 221},
+ {"seats": [90,94],"winnerTo": 92,"loserTo": 167},
+ {"seats": [93,95],"winnerTo": 94,"loserTo": 223},
+ {"seats": [80,112],"winnerTo": 96,"loserTo": 193},
+ {"seats": [97,99],"winnerTo": 98,"loserTo": 231},
+ {"seats": [98,102],"winnerTo": 100,"loserTo": 157},
+ {"seats": [101,103],"winnerTo": 102,"loserTo": 233},
+ {"seats": [100,108],"winnerTo": 104,"loserTo": 227},
+ {"seats": [105,107],"winnerTo": 106,"loserTo": 237},
+ {"seats": [106,110],"winnerTo": 108,"loserTo": 151},
+ {"seats": [109,111],"winnerTo": 110,"loserTo": 239},
+ {"seats": [104,120],"winnerTo": 112,"loserTo": 133},
+ {"seats": [113,115],"winnerTo": 114,"loserTo": 245},
+ {"seats": [114,118],"winnerTo": 116,"loserTo": 143},
+ {"seats": [117,119],"winnerTo": 118,"loserTo": 247},
+ {"seats": [116,124],"winnerTo": 120,"loserTo": 241},
+ {"seats": [121,123],"winnerTo": 122,"loserTo": 251},
+ {"seats": [122,126],"winnerTo": 124,"loserTo": 137},
+ {"seats": [125,127],"winnerTo": 126,"loserTo": 253},
+
+ {"seats": [139,141],"winnerTo": 140,"loserTo": null},
+ {"seats": [145,147],"winnerTo": 146,"loserTo": null},
+ {"seats": [153,155],"winnerTo": 154,"loserTo": null},
+ {"seats": [159,161],"winnerTo": 160,"loserTo": null},
+ {"seats": [169,171],"winnerTo": 170,"loserTo": null},
+ {"seats": [175,177],"winnerTo": 176,"loserTo": null},
+ {"seats": [183,185],"winnerTo": 184,"loserTo": null},
+ {"seats": [189,191],"winnerTo": 190,"loserTo": null},
+ {"seats": [201,203],"winnerTo": 202,"loserTo": null},
+ {"seats": [207,209],"winnerTo": 208,"loserTo": null},
+ {"seats": [215,217],"winnerTo": 216,"loserTo": null},
+ {"seats": [221,223],"winnerTo": 222,"loserTo": null},
+ {"seats": [231,233],"winnerTo": 232,"loserTo": null},
+ {"seats": [237,239],"winnerTo": 238,"loserTo": null},
+ {"seats": [245,247],"winnerTo": 246,"loserTo": null},
+ {"seats": [251,253],"winnerTo": 252,"loserTo": null},
+
+ {"seats": [143,146],"winnerTo": 144,"loserTo": null},
+ {"seats": [151,154],"winnerTo": 152,"loserTo": null},
+ {"seats": [157,160],"winnerTo": 158,"loserTo": null},
+ {"seats": [167,170],"winnerTo": 168,"loserTo": null},
+ {"seats": [173,176],"winnerTo": 174,"loserTo": null},
+ {"seats": [181,184],"winnerTo": 182,"loserTo": null},
+ {"seats": [187,190],"winnerTo": 188,"loserTo": null},
+ {"seats": [199,202],"winnerTo": 200,"loserTo": null},
+ {"seats": [205,208],"winnerTo": 206,"loserTo": null},
+ {"seats": [213,216],"winnerTo": 214,"loserTo": null},
+ {"seats": [219,222],"winnerTo": 220,"loserTo": null},
+ {"seats": [229,232],"winnerTo": 230,"loserTo": null},
+ {"seats": [235,238],"winnerTo": 236,"loserTo": null},
+ {"seats": [243,246],"winnerTo": 244,"loserTo": null},
+ {"seats": [249,252],"winnerTo": 250,"loserTo": null},
+ {"seats": [137,140],"winnerTo": 138,"loserTo": null},
+
+ {"seats": [138,144],"winnerTo": 142,"loserTo": null},
+ {"seats": [152,158],"winnerTo": 156,"loserTo": null},
+ {"seats": [168,174],"winnerTo": 172,"loserTo": null},
+ {"seats": [182,188],"winnerTo": 186,"loserTo": null},
+ {"seats": [200,206],"winnerTo": 204,"loserTo": null},
+ {"seats": [214,220],"winnerTo": 218,"loserTo": null},
+ {"seats": [230,236],"winnerTo": 234,"loserTo": null},
+ {"seats": [244,250],"winnerTo": 248,"loserTo": null},
+
+ {"seats": [179,186],"winnerTo": 180,"loserTo": null},
+ {"seats": [149,156],"winnerTo": 150,"loserTo": null},
+ {"seats": [165,172],"winnerTo": 166,"loserTo": null},
+ {"seats": [197,204],"winnerTo": 198,"loserTo": null},
+ {"seats": [211,218],"winnerTo": 212,"loserTo": null},
+ {"seats": [227,234],"winnerTo": 228,"loserTo": null},
+ {"seats": [241,248],"winnerTo": 242,"loserTo": null},
+ {"seats": [135,142],"winnerTo": 136,"loserTo": null},
+
+ {"seats": [136,150],"winnerTo": 148,"loserTo": null},
+ {"seats": [228,242],"winnerTo": 240,"loserTo": null},
+ {"seats": [166,180],"winnerTo": 178,"loserTo": null},
+ {"seats": [198,212],"winnerTo": 210,"loserTo": null},
+
+
+ {"seats": [163,178],"winnerTo": 164,"loserTo": null},
+ {"seats": [195,210],"winnerTo": 196,"loserTo": null},
+ {"seats": [225,240],"winnerTo": 226,"loserTo": null},
+ {"seats": [133,148],"winnerTo": 134,"loserTo": null},
+
+ {"seats": [134,164],"winnerTo": 162,"loserTo": null},
+ {"seats": [196,226],"winnerTo": 224,"loserTo": null},
+
+ {"seats": [193,224],"winnerTo": 194,"loserTo": null},
+ {"seats": [131,162],"winnerTo": 132,"loserTo": null},
+
+ {"seats": [132,194],"winnerTo": 192,"loserTo": null},
+
+ {"seats": [129,192],"winnerTo": 130,"loserTo": null},
+
+ {"seats": [64,130],"winnerTo": null,"loserTo": null}
+ ],
+ "startingSeats": [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,
+ 41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,
+ 89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127]
+}
View
50 lib/bracket_tree/templates/double_elimination/8.json
@@ -0,0 +1,50 @@
+{
+"nodes":[
+ { "seats": [1,3], "winnerTo": 2, "loserTo": 21 },
+ { "seats": [5,7], "winnerTo": 6, "loserTo": 23 },
+ { "seats": [9,11], "winnerTo": 10, "loserTo": 25 },
+ { "seats": [13,15], "winnerTo": 14, "loserTo": 27 },
+ { "seats": [2,6], "winnerTo": 4, "loserTo": 29 },
+ { "seats": [10,14], "winnerTo": 12, "loserTo": 19 },
+ { "seats": [21,23], "winnerTo": 22, "loserTo": null },
+ { "seats": [25,27], "winnerTo": 26, "loserTo": null },
+ { "seats": [4,12], "winnerTo": 8, "loserTo": 17 },
+ { "seats": [19,22], "winnerTo": 20, "loserTo": null },
+ { "seats": [26,29], "winnerTo": 28, "loserTo": null },
+ { "seats": [20,28], "winnerTo": 24, "loserTo": null },
+ { "seats": [17,24], "winnerTo": 18, "loserTo": null },
+ { "seats": [8,18], "winnerTo": null, "loserTo": null }
+],
+"seats":[
+ { "position":16 },
+ { "position":8 },
+ { "position":18 },
+ { "position":4 },
+ { "position":12 },
+ { "position":17 },
+ { "position":24 },
+ { "position":20 },
+ { "position":28 },
+ { "position":19 },
+ { "position":22 },
+ { "position":26 },
+ { "position":29 },
+ { "position":21 },
+ { "position":23 },
+ { "position":25 },
+ { "position":27 },
+ { "position":2 },
+ { "position":6 },
+ { "position":10 },
+ { "position":14 },
+ { "position":1 },
+ { "position":3 },
+ { "position":5 },
+ { "position":7 },
+ { "position":9 },
+ { "position":11 },
+ { "position":13 },
+ { "position":15 }
+],
+"startingSeats":[1,3,5,7,9,11,13,15]
+}
View
11 lib/bracket_tree/templates/single_elimination.rb
@@ -0,0 +1,11 @@
+module BracketTree
+ module Template
+ class SingleElimination < Base
+ class << self
+ def location
+ File.join File.dirname(__FILE__), 'templates', 'single_elimination'
+ end
+ end
+ end
+ end
+end
View
1,917 lib/bracket_tree/templates/single_elimination/128.json
@@ -0,0 +1,1917 @@
+{
+ "nodes": [
+ {
+ "seats": [
+ 1,
+ 3
+ ],
+ "winnerTo": 2,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 5,
+ 7
+ ],
+ "winnerTo": 6,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 9,
+ 11
+ ],
+ "winnerTo": 10,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 13,
+ 15
+ ],
+ "winnerTo": 14,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 17,
+ 19
+ ],
+ "winnerTo": 18,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 21,
+ 23
+ ],
+ "winnerTo": 22,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 25,
+ 27
+ ],
+ "winnerTo": 26,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 29,
+ 31
+ ],
+ "winnerTo": 30,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 33,
+ 35
+ ],
+ "winnerTo": 34,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 37,
+ 39
+ ],
+ "winnerTo": 38,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 41,
+ 43
+ ],
+ "winnerTo": 42,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 45,
+ 47
+ ],
+ "winnerTo": 46,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 49,
+ 51
+ ],
+ "winnerTo": 50,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 53,
+ 55
+ ],
+ "winnerTo": 54,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 57,
+ 59
+ ],
+ "winnerTo": 58,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 61,
+ 63
+ ],
+ "winnerTo": 62,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 65,
+ 67
+ ],
+ "winnerTo": 66,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 69,
+ 71
+ ],
+ "winnerTo": 70,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 73,
+ 75
+ ],
+ "winnerTo": 74,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 77,
+ 79
+ ],
+ "winnerTo": 78,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 81,
+ 83
+ ],
+ "winnerTo": 82,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 85,
+ 87
+ ],
+ "winnerTo": 86,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 89,
+ 91
+ ],
+ "winnerTo": 90,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 93,
+ 95
+ ],
+ "winnerTo": 94,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 97,
+ 99
+ ],
+ "winnerTo": 98,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 101,
+ 103
+ ],
+ "winnerTo": 102,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 105,
+ 107
+ ],
+ "winnerTo": 106,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 109,
+ 111
+ ],
+ "winnerTo": 110,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 113,
+ 115
+ ],
+ "winnerTo": 114,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 117,
+ 119
+ ],
+ "winnerTo": 118,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 121,
+ 123
+ ],
+ "winnerTo": 122,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 125,
+ 127
+ ],
+ "winnerTo": 126,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 129,
+ 131
+ ],
+ "winnerTo": 130,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 133,
+ 135
+ ],
+ "winnerTo": 134,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 137,
+ 139
+ ],
+ "winnerTo": 138,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 141,
+ 143
+ ],
+ "winnerTo": 142,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 145,
+ 147
+ ],
+ "winnerTo": 146,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 149,
+ 151
+ ],
+ "winnerTo": 150,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 153,
+ 155
+ ],
+ "winnerTo": 154,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 157,
+ 159
+ ],
+ "winnerTo": 158,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 161,
+ 163
+ ],
+ "winnerTo": 162,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 165,
+ 167
+ ],
+ "winnerTo": 166,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 169,
+ 171
+ ],
+ "winnerTo": 170,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 173,
+ 175
+ ],
+ "winnerTo": 174,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 177,
+ 179
+ ],
+ "winnerTo": 178,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 181,
+ 183
+ ],
+ "winnerTo": 182,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 185,
+ 187
+ ],
+ "winnerTo": 186,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 189,
+ 191
+ ],
+ "winnerTo": 190,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 193,
+ 195
+ ],
+ "winnerTo": 194,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 197,
+ 199
+ ],
+ "winnerTo": 198,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 201,
+ 203
+ ],
+ "winnerTo": 202,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 205,
+ 207
+ ],
+ "winnerTo": 206,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 209,
+ 211
+ ],
+ "winnerTo": 210,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 213,
+ 215
+ ],
+ "winnerTo": 214,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 217,
+ 219
+ ],
+ "winnerTo": 218,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 221,
+ 223
+ ],
+ "winnerTo": 222,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 225,
+ 227
+ ],
+ "winnerTo": 226,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 229,
+ 231
+ ],
+ "winnerTo": 230,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 233,
+ 235
+ ],
+ "winnerTo": 234,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 237,
+ 239
+ ],
+ "winnerTo": 238,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 241,
+ 243
+ ],
+ "winnerTo": 242,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 245,
+ 247
+ ],
+ "winnerTo": 246,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 249,
+ 251
+ ],
+ "winnerTo": 250,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 253,
+ 255
+ ],
+ "winnerTo": 254,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 2,
+ 6
+ ],
+ "winnerTo": 4,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 10,
+ 14
+ ],
+ "winnerTo": 12,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 18,
+ 22
+ ],
+ "winnerTo": 20,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 26,
+ 30
+ ],
+ "winnerTo": 28,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 34,
+ 38
+ ],
+ "winnerTo": 36,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 42,
+ 46
+ ],
+ "winnerTo": 44,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 50,
+ 54
+ ],
+ "winnerTo": 52,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 58,
+ 62
+ ],
+ "winnerTo": 60,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 66,
+ 70
+ ],
+ "winnerTo": 68,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 74,
+ 78
+ ],
+ "winnerTo": 76,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 82,
+ 86
+ ],
+ "winnerTo": 84,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 90,
+ 94
+ ],
+ "winnerTo": 92,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 98,
+ 102
+ ],
+ "winnerTo": 100,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 106,
+ 110
+ ],
+ "winnerTo": 108,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 114,
+ 118
+ ],
+ "winnerTo": 116,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 122,
+ 126
+ ],
+ "winnerTo": 124,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 130,
+ 134
+ ],
+ "winnerTo": 132,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 138,
+ 142
+ ],
+ "winnerTo": 140,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 146,
+ 150
+ ],
+ "winnerTo": 148,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 154,
+ 158
+ ],
+ "winnerTo": 156,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 162,
+ 166
+ ],
+ "winnerTo": 164,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 170,
+ 174
+ ],
+ "winnerTo": 172,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 178,
+ 182
+ ],
+ "winnerTo": 180,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 186,
+ 190
+ ],
+ "winnerTo": 188,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 194,
+ 198
+ ],
+ "winnerTo": 196,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 202,
+ 206
+ ],
+ "winnerTo": 204,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 210,
+ 214
+ ],
+ "winnerTo": 212,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 218,
+ 222
+ ],
+ "winnerTo": 220,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 226,
+ 230
+ ],
+ "winnerTo": 228,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 234,
+ 238
+ ],
+ "winnerTo": 236,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 242,
+ 246
+ ],
+ "winnerTo": 244,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 250,
+ 254
+ ],
+ "winnerTo": 252,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 4,
+ 12
+ ],
+ "winnerTo": 8,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 20,
+ 28
+ ],
+ "winnerTo": 24,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 36,
+ 44
+ ],
+ "winnerTo": 40,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 52,
+ 60
+ ],
+ "winnerTo": 56,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 68,
+ 76
+ ],
+ "winnerTo": 72,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 84,
+ 92
+ ],
+ "winnerTo": 88,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 100,
+ 108
+ ],
+ "winnerTo": 104,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 116,
+ 124
+ ],
+ "winnerTo": 120,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 132,
+ 140
+ ],
+ "winnerTo": 136,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 148,
+ 156
+ ],
+ "winnerTo": 152,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 164,
+ 172
+ ],
+ "winnerTo": 168,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 180,
+ 188
+ ],
+ "winnerTo": 184,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 196,
+ 204
+ ],
+ "winnerTo": 200,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 212,
+ 220
+ ],
+ "winnerTo": 216,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 228,
+ 236
+ ],
+ "winnerTo": 232,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 244,
+ 252
+ ],
+ "winnerTo": 248,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 8,
+ 24
+ ],
+ "winnerTo": 16,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 40,
+ 56
+ ],
+ "winnerTo": 48,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 72,
+ 88
+ ],
+ "winnerTo": 80,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 104,
+ 120
+ ],
+ "winnerTo": 112,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 136,
+ 152
+ ],
+ "winnerTo": 144,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 168,
+ 184
+ ],
+ "winnerTo": 176,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 200,
+ 216
+ ],
+ "winnerTo": 208,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 232,
+ 248
+ ],
+ "winnerTo": 240,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 16,
+ 48
+ ],
+ "winnerTo": 32,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 80,
+ 112
+ ],
+ "winnerTo": 96,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 144,
+ 176
+ ],
+ "winnerTo": 160,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 208,
+ 240
+ ],
+ "winnerTo": 224,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 32,
+ 96
+ ],
+ "winnerTo": 64,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 160,
+ 224
+ ],
+ "winnerTo": 192,
+ "loserTo": null
+ },
+ {
+ "seats": [
+ 64,
+ 192
+ ],
+ "winnerTo": null,
+ "loserTo": null
+ }
+ ],
+ "seats": [
+ {
+ "position": 256
+ },
+ {
+ "position": 64
+ },
+ {
+ "position": 192
+ },
+ {
+ "position": 32
+ },
+ {
+ "position": 96
+ },
+ {
+ "position": 160
+ },
+ {
+ "position": 224
+ },
+ {
+ "position": 16
+ },
+ {
+ "position": 48
+ },
+ {
+ "position": 80
+ },
+ {
+ "position": 112
+ },
+ {
+ "position": 144
+ },
+ {
+ "position": 176
+ },
+ {
+ "position": 208
+ },
+ {
+ "position": 240
+ },
+ {
+ "position": 8
+ },
+ {
+ "position": 24
+ },
+ {
+ "position": 40
+ },
+ {
+ "position": 56
+ },
+ {
+ "position": 72
+ },
+ {
+ "position": 88
+ },
+ {
+ "position": 104
+ },
+ {
+ "position": 120
+ },
+ {
+ "position": 136
+ },
+ {
+ "position": 152
+ },
+ {
+ "position": 168
+ },
+ {
+ "position": 184
+ },
+ {
+ "position": 200
+ },
+ {
+ "position": 216
+ },
+ {
+ "position": 232
+ },
+ {
+ "position": 248
+ },
+ {
+ "position": 4
+ },
+ {
+ "position": 12
+ },
+ {
+ "position": 20
+ },
+ {
+ "position": 28
+ },
+ {
+ "position": 36
+ },
+ {
+ "position": 44
+ },
+ {
+ "position": 52
+ },
+ {
+ "position": 60
+ },
+ {
+ "position": 68
+ },
+ {
+ "position": 76
+ },
+ {
+ "position": 84
+ },
+ {
+ "position": 92
+ },
+ {
+ "position": 100
+ },
+ {
+ "position": 108
+ },
+ {
+ "position": 116
+ },
+ {
+ "position": 124
+ },
+ {
+ "position": 132
+ },
+ {
+ "position": 140
+ },
+ {
+ "position": 148
+ },
+ {
+ "position": 156
+ },
+ {
+ "position": 164
+ },
+ {
+ "position": 172
+ },
+ {
+ "position": 180
+ },
+ {
+ "position": 188
+ },
+ {
+ "position": 196
+ },
+ {
+ "position": 204
+ },
+ {
+ "position": 212
+ },
+ {
+ "position": 220
+ },
+ {
+ "position": 228
+ },
+ {
+ "position": 236
+ },
+ {
+ "position": 244
+ },
+ {
+ "position": 252
+ },
+ {
+ "position": 2
+ },
+ {
+ "position": 6
+ },
+ {
+ "position": 10
+ },
+ {
+ "position": 14
+ },
+ {
+ "position": 18
+ },
+ {
+ "position": 22
+ },
+ {
+ "position": 26
+ },
+ {
+ "position": 30
+ },
+ {
+ "position": 34
+ },
+ {
+ "position": 38
+ },
+ {
+ "position": 42
+ },
+ {
+ "position": 46
+ },
+ {
+ "position": 50
+ },
+ {
+ "position": 54
+ },
+ {
+ "position": 58
+ },
+ {
+ "position": 62
+ },
+ {
+ "position": 66
+ },
+ {
+ "position": 70
+ },
+ {
+ "position": 74
+ },
+ {
+ "position": 78
+ },
+ {
+ "position": 82
+ },
+ {
+ "position": 86
+ },
+ {
+ "position": 90
+ },
+ {
+ "position": 94