amcardle98 / tournamant-bracket

0 stars 0 forks source link

Display brackets logically #1

Open amcardle98 opened 1 year ago

amcardle98 commented 1 year ago

I have no clue how to display the brackets logically meaning if 8 people are playing, there will be 7 matches played and 3 rounds.

Obviously this needs to be displayed on html. But the html needs to be variable depending on how many players. I was thinking like breaking the html up into colums for the rounds, so have like ngFor="rounds" so it should be 3 colums, then inside that have a nested ngFor="matches". But the matches will decrease in each round so for the first round it should have 4 matches, then 2 , then 1. i guess it could be like ngFor="ceil(matches/2).

Let me know your input.

AadamZ5 commented 1 year ago

Each "match" would have two other child matches (except for lowest level matches, beginning of tourny), where the winners of those child matches determine the players of this match.

It seems like you've gotten started on the data structure, but I'm not yet familiar. I'm wondering if we can design some sort of recursive option, instead of an iteration option. The reason for this would be the nested match lineup.

If we went with a recursive option, we could potentially benefit from implicit HTML and CSS styling.

I'll try and draft something up on a branch.