Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Poziom kodowania: początkujący Czas trwania: 5 minut Typ projektu: automatyzacja za pomocą menu niestandardowego
Cele
Dowiedz się, co robi rozwiązanie.
Dowiedz się, jakie funkcje pełnią usługi Apps Script w rozwiązaniu.
Skonfiguruj skrypt.
Uruchom skrypt.
Informacje o rozwiązaniu
Utwórz drabinkę turniejową dla maksymalnie 64 osób lub zespołów. To rozwiązanie tworzy diagram drzewa przedstawiający turniej systemem pucharowym.
Jak to działa
Skrypt przechodzi przez listę graczy i określa, ile rund jest potrzebnych w turnieju. Skrypt formatuje arkusz Bracket, aby utworzyć diagram drzewa, i dodaje imiona graczy do pierwszej rundy.
W skopiowanym arkuszu kliknij Kreator drabinek>Utwórz drabinkę. Aby wyświetlić to menu niestandardowe, konieczne może być odświeżenie strony.
Gdy pojawi się odpowiedni komunikat, autoryzuj skrypt.
Jeśli na ekranie zgody OAuth wyświetla się ostrzeżenie Ta aplikacja nie została zweryfikowana, kliknij kolejno Zaawansowane>Otwórz {Project Name} (niebezpieczne).
Kliknij Kreator drabinek>Utwórz drabinkę.
Aby wyświetlić drabinkę turniejową, przejdź na kartę Drabinka.
Sprawdź kod
Aby sprawdzić kod Apps Script tego rozwiązania, kliknij poniżej Wyświetl kod źródłowy:
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-09-12 UTC."],[[["\u003cp\u003eThis script automates the creation of a single-elimination tournament bracket for up to 64 players or teams in Google Sheets.\u003c/p\u003e\n"],["\u003cp\u003eIt uses the Spreadsheet service to get player data and generate the bracket diagram on a separate sheet.\u003c/p\u003e\n"],["\u003cp\u003eUsers need a Google Account and web browser to utilize this tool, and can set it up by making a copy of the provided spreadsheet and running the script from the custom menu.\u003c/p\u003e\n"],["\u003cp\u003eThe script randomly assigns players to the bracket, ensuring each spot is filled, and accommodates byes for an uneven number of participants.\u003c/p\u003e\n"]]],["This script automates the creation of a single-elimination tournament bracket for up to 64 players. Utilizing the Spreadsheet service, it determines the necessary rounds, formats the \"Bracket\" sheet to display a tree diagram, and populates the first round with player names from the \"Players\" sheet. A custom menu, \"Bracket maker\", allows the user to trigger the `createBracket` function, which generates the bracket after obtaining user authorization. The code then uses loops to manage player distribution and bracket formatting.\n"],null,[]]