{"id":17965231,"url":"https://github.com/tokenrove/advent-of-code-2017","last_synced_at":"2026-01-29T23:31:41.170Z","repository":{"id":147612910,"uuid":"112744340","full_name":"tokenrove/advent-of-code-2017","owner":"tokenrove","description":null,"archived":false,"fork":false,"pushed_at":"2018-04-10T23:48:27.000Z","size":35,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-05T16:07:26.867Z","etag":null,"topics":["advent-of-code","polyglot","practice"],"latest_commit_sha":null,"homepage":"http://adventofcode.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tokenrove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-12-01T13:43:07.000Z","updated_at":"2018-04-10T23:48:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"6ceed470-d176-42d6-bae5-405cc19082d7","html_url":"https://github.com/tokenrove/advent-of-code-2017","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tokenrove/advent-of-code-2017","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Fadvent-of-code-2017","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Fadvent-of-code-2017/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Fadvent-of-code-2017/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Fadvent-of-code-2017/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tokenrove","download_url":"https://codeload.github.com/tokenrove/advent-of-code-2017/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Fadvent-of-code-2017/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28890340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","polyglot","practice"],"created_at":"2024-10-29T12:10:33.462Z","updated_at":"2026-01-29T23:31:41.152Z","avatar_url":"https://github.com/tokenrove.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nMy goal, like last year, is to do each day in a different language.\nWe'll see what happens.  I might go back and do multiple solutions for\none day if I regret not doing something in APL or Lisp.\n\nI should add the disclaimer that many of these solutions are not\nidiomatic in the languages chosen.  Sometimes because I'm unaware of\nthe conventions, and sometimes because I'm actively defying them.\n\n[Previously.](https://github.com/tokenrove/advent-of-code-2016)\n\n- [1](day1.fut): [Futhark](http://futhark-lang.org)\n  - `s ← \"123123\" ⋄ +/⍎¨\"0\",s/⍨s=s⌽⍨2÷⍨⍴s` in APL\n- [2](day2.rb): [Ruby](https://www.ruby-lang.org/)\n  - `+/ ((#~(=\u003e.))@(#~(1\u0026~:))@,@(%/]))\"1 is` in J\n- [3](day3.fs): [F#](http://fsharp.org/)\n  - Also [in CL](day3.lisp).  Wanted a language with both generators\n    and complex numbers for this; surprisingly hard ask.\n- [4](day4.scm): [Guile Scheme](https://www.gnu.org/s/guile)\n  - `sum(1 for l in f if len({''.join(sorted(w)) for w in l.split()}) == len(l.split()))`\n- [5](day5.s): bootable x86 asm using `BOUND` instruction\n  - `for (size_t i = 0; i \u003c N; ++n) i += j[i] \u003c3 ? j[i]++ : j[i]--;`\n- [6](day6.st): [GNU Smalltalk](http://smalltalk.gnu.org/)\n- [7](day7.pl): [SWI Prolog](http://www.swi-prolog.org/)\n- [8](day8.factor): [Factor](http://factorcode.org/)\n- [9](day9.icn): [Icon](https://www2.cs.arizona.edu/icon/)\n\nSome of the discussion around this lead to demoing some of these as\n(excessively-unPythonic) Python list comprehensions:\n\n```python\nwith open('day1.in') as f: ds = [int(c) for c in f.readline().strip()]\nr = 1 # or len(ds)/2 for part 2\nsum(a for (a,b) in zip(ds, ds[r:] + [ds[:r]]) if a == b)\n```\n\n```python\nwith open('day2.in') as f: ls = [[int(i) for i in line.strip().split()] for line in f]\nsum(max(row)-min(row) for row in ls)\nsum([q//d for q in row for d in row if q != d and 0 == q % d][0] for row in ls)\n```\n\n``` python\nwith open('day4.in') as f: sum(1 for l in f if len(set(l.split())) == len(l.split()))\nwith open('day4.in') as f: sum(1 for l in f if len({''.join(sorted(w)) for w in l.split()}) == len(l.split()))\n```\n\n``` python\n\u003e\u003e\u003e with open(\"day5.in\") as f: jumps = [int(i) for i in f]\n\u003e\u003e\u003e i,n = 0,0\n\u003e\u003e\u003e while 0 \u003c= i \u003c len(jumps): j = i+jumps[i]; jumps[i] = jumps[i] + (1 if jumps[i] \u003c 3 else -1); n += 1; i = j\n\u003e\u003e\u003e print(n)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokenrove%2Fadvent-of-code-2017","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftokenrove%2Fadvent-of-code-2017","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokenrove%2Fadvent-of-code-2017/lists"}