{"id":16724942,"url":"https://github.com/kaworu/adventofcode-2015","last_synced_at":"2025-10-17T12:27:48.157Z","repository":{"id":47133382,"uuid":"75457316","full_name":"kaworu/adventofcode-2015","owner":"kaworu","description":"Advent of Code 2015 puzzles and solutions","archived":false,"fork":false,"pushed_at":"2021-09-12T21:46:47.000Z","size":154,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-22T05:17:11.471Z","etag":null,"topics":["awk","coding-challenge"],"latest_commit_sha":null,"homepage":"","language":"Awk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaworu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-03T06:48:04.000Z","updated_at":"2024-10-27T16:53:57.000Z","dependencies_parsed_at":"2022-08-24T20:20:42.901Z","dependency_job_id":null,"html_url":"https://github.com/kaworu/adventofcode-2015","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaworu%2Fadventofcode-2015","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaworu%2Fadventofcode-2015/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaworu%2Fadventofcode-2015/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaworu%2Fadventofcode-2015/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaworu","download_url":"https://codeload.github.com/kaworu/adventofcode-2015/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243746233,"owners_count":20341203,"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":["awk","coding-challenge"],"created_at":"2024-10-12T22:47:20.889Z","updated_at":"2025-10-17T12:27:43.127Z","avatar_url":"https://github.com/kaworu.png","language":"Awk","readme":"![Test](https://github.com/kAworu/adventofcode-2015/workflows/Test/badge.svg)\n\n# Advent of Code 2015\n\nhttps://adventofcode.com puzzles solutions in [AWK][].\n\n\u003e Advent of Code is a series of small programming puzzles for a variety of\n\u003e skill levels. They are self-contained and are just as appropriate for an\n\u003e expert who wants to stay sharp as they are for a beginner who is just\n\u003e learning to code. Each puzzle calls upon different skills and has two parts\n\u003e that build on a theme.\n\n## Why AWK?\n\nAfter solving the firsts two or three puzzle, I thought that AWK would be an\nideal language. The puzzle input is (usually) to be parsed either line-by-line\nor sometimes character-by-character; AWK excel at both. As a results, solutions\ncontain very few parsing related lines of code and can be focused on the\nproblem.\n\n## And?\n\nThen _Day 04 - The Ideal Stocking Stuffer_ required to compute *a lot* of MD5\nhashes and it became quite challenging due to AWK's limitations. Using pipe has\nserious performance and portability impact, [dynamic extensions][] is limited\nto Gawk and greatly limit usability. Implementing MD5 in pure AWK is tricky\nbecause it lacks bitwise operators (Gawk and busybox awk have them though).\n\nAlso puzzles gets harder as days goes by, to the point that finding elegant AWK\nsolution become really challenging. The most outstanding limitations are:\n\n- **There are very few built-in functions** and (almost) all of them are string\n  processing functions. Hasn't been a big issue since most challenges are\n  mathematical puzzles.\n\n- **Only two scalar types** (if we omit regexp): strings and Double-precision\n  floating-point numbers. This makes some stuff usually ubiquitous in \"general\n  purpose\" programming languages (e.g. bitwise operations) a bit tricky.\n\n- **It is not possible to return associative arrays from functions**. This can\n  be worked around by passing an array as parameter that is to be modified by\n  the function.\n\n- **The only composite type — associative arrays — is not recursive** (values\n  are limited to numbers or strings). Because of this, it is often hard to\n  implement solutions able to solve the general case problem as they can\n  require an \"additional\" dimension (e.g. 4 lines input vs arbitrary lines\n  input). To work around this issue I've used multiple array subscripts (which\n  is really only syntactic sugar), function recursion (basically using the call\n  stack \"as a dimension\"), and serialization to string.\n\n[AWK]: https://en.wikipedia.org/wiki/AWK\n[dynamic extensions]: https://www.gnu.org/software/gawk/manual/html_node/Dynamic-Extensions.html\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaworu%2Fadventofcode-2015","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaworu%2Fadventofcode-2015","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaworu%2Fadventofcode-2015/lists"}