{"id":22889198,"url":"https://github.com/swiftlang/swift-aoc-starter-example","last_synced_at":"2025-05-16T18:08:08.320Z","repository":{"id":210145534,"uuid":"725830812","full_name":"swiftlang/swift-aoc-starter-example","owner":"swiftlang","description":"Swift starter project for solving Advent of Code challenges.","archived":false,"fork":false,"pushed_at":"2024-12-01T00:12:53.000Z","size":25,"stargazers_count":240,"open_issues_count":2,"forks_count":44,"subscribers_count":127,"default_branch":"main","last_synced_at":"2025-03-27T17:16:17.951Z","etag":null,"topics":["advent-of-code","advent-of-code-2023","advent-of-code-2023-swift","swift"],"latest_commit_sha":null,"homepage":"https://adventofcode.com","language":"Swift","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swiftlang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-01T00:42:09.000Z","updated_at":"2025-03-18T10:11:02.000Z","dependencies_parsed_at":"2024-12-01T00:37:46.011Z","dependency_job_id":null,"html_url":"https://github.com/swiftlang/swift-aoc-starter-example","commit_stats":null,"previous_names":["apple/swift-aoc-starter-example","swiftlang/swift-aoc-starter-example"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftlang%2Fswift-aoc-starter-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftlang%2Fswift-aoc-starter-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftlang%2Fswift-aoc-starter-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftlang%2Fswift-aoc-starter-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftlang","download_url":"https://codeload.github.com/swiftlang/swift-aoc-starter-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247052619,"owners_count":20875685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advent-of-code","advent-of-code-2023","advent-of-code-2023-swift","swift"],"created_at":"2024-12-13T21:08:02.577Z","updated_at":"2025-04-03T18:14:22.808Z","avatar_url":"https://github.com/swiftlang.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Advent of Code Swift Starter Project\n\n[![Language](https://img.shields.io/badge/language-Swift-red.svg)](https://swift.org)\n\nDaily programming puzzles at [Advent of Code](\u003chttps://adventofcode.com/\u003e), by\n[Eric Wastl](\u003chttp://was.tl/\u003e). This is a small example starter project for\nbuilding Advent of Code solutions.\n\n## Usage\n\nSwift comes with Xcode, or you can [install it](https://www.swift.org/install/)\non a supported macOS, Linux, or Windows platform. \n\nIf you're using Xcode, you can open this project by choosing File / Open and\nselect the parent directory. \n\nIf you prefer the command line, you can run the test suite with `swift test`,\nand run the output with `swift run`.\n\nIf you're using Visual Studio Code to edit, you might find these Swift\nextensions useful:\n\n- [Swift](https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang)\n  (provides core language edit / debug / test features)\n- [apple-swift-format](https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-apple-swift-format)\n  (supports the [swift-format](https://github.com/apple/swift-format) package)\n\n## Challenges\n\nThe challenges assume three files (replace 00 with the day of the challenge).\n\n- `Sources/Data/Day00.txt`: the input data provided for the challenge\n- `Sources/Day00.swift`: the code to solve the challenge\n- `Tests/Day00.swift`: any unit tests that you want to include\n\nTo start a new day's challenge, make a copy of these files, updating 00 to the \nday number.\n\n```diff\n// Add each new day implementation to this array:\nlet allChallenges: [any AdventDay] = [\n-  Day00()\n+  Day00(),\n+  Day01(),\n]\n```\n\nThen implement part 1 and 2. The `AdventOfCode.swift` file controls which challenge\nis run with `swift run`. Add your new type to its `allChallenges` array. By default \nit runs the most recent challenge.\n\nThe `AdventOfCode.swift` file controls which day's challenge is run\nwith `swift run`. By default that runs the most recent challenge in the package.\n\nTo supply command line arguments use `swift run AdventOfCode`. For example,\n`swift run -c release AdventOfCode --benchmark 3` builds the binary with full\noptimizations, and benchmarks the challenge for day 3.\n\n## Linting and Formatting\n\nChallenge source code can be linted and formatted automatically using the\nincluded dependency on `swift-format`.\n\nLint source code with the following command:\n\n```shell\n$ swift package lint-source-code\n```\n\nFormat source code with the following command:\n\n```shell\n$ swift package format-source-code\nPlugin ‘Format Source Code’ wants permission to write to the package directory.\nStated reason: “This command formats the Swift source files”.\nAllow this plugin to write to the package directory? (yes/no)\n```\n\nTo avoid the interactive prompt when formatting source code, use the \n`--allow-writing-to-package-directory` flag.\n \n```shell\n$ swift package format-source-code --allow-writing-to-package-directory\n```\n\nswift-format will use the built-in default style to lint and format code. A\n`.swift-format` configuration file can be used to customize the style used, see\n[Configuration](https://github.com/apple/swift-format/blob/main/Documentation/Configuration.md)\nfor more details. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftlang%2Fswift-aoc-starter-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftlang%2Fswift-aoc-starter-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftlang%2Fswift-aoc-starter-example/lists"}