/aoc22_dart_code_golf

AdventOfCode 2022 in Dart focusing on code golf, making the solutions as small as possible

Primary LanguageDartApache License 2.0Apache-2.0

Advent of Code 2022 in Dart (Code Golf)

This is my attempt at solving the Advent of Code 2022 puzzles in the shortest possible code using Dart 2.18.

You can find the solution in /bin.

I created .min.dart file containing the shortest possible code for each puzzle.

The normal dart files are the same code I used to solve the puzzles in the first place before starting to code golf the solutions.

Rules

  • The Dart program has to have a main(List<String> args) entrypoint.
  • The input is read from file and passed into the main function line by line.
  • External dependencies are not allowed.
  • The output is printed via print()

See the mainTester() function as reference

Results

Day 1

Part 1: 84 chars | Part 2: 129 chars

Day 2

Part 1: 116 chars | Part 2: 119 chars

Day 3

Part 1: 168 chars | Part 2: 178 chars

Day 4

Part 1: 138 chars | Part 2: 136 chars

Day 5

Part 1: 393 chars | Part 2: 384 chars

Day 6

Part 1: 101 chars | Part 2: 103 chars

Day 7

Part 1: 415 chars | Part 2: 434 chars

Day 8

Part 1: 339 chars | Part 2: >1k chars

Day 9

Part 1: >1k chars | Part 2: >1k chars

Day 10

Part 1: 129 chars | Part 2: 158 chars

Day 11

Part 1: >1k chars | Part 2: >1k chars

Day 12

Part 1: >2k chars | Part 2: >2k chars

Day 13

Part 1: - chars | Part 2: - chars

Day 14

Part 1: - chars | Part 2: - chars

Day 15

Part 1: - chars | Part 2: - chars

Day 16

Part 1: - chars | Part 2: - chars

Day 17

Part 1: - chars | Part 2: - chars

Day 18

Part 1: - chars | Part 2: - chars

Day 19

Part 1: - chars | Part 2: - chars

Day 20

Part 1: - chars | Part 2: - chars

Day 21

Part 1: >1k chars | Part 2: >1k chars

Day 22

Part 1: >1k chars | Part 2: >1k chars

Day 23

Part 1: >1k chars | Part 2: >1k chars

Day 24

Part 1: >1k chars | Part 2: >1k chars

License

Copyright 2022 Pascal Welsch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.