Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kiranandcode/aoc-rhombus
Let's do AOC in Rhombus!!! (Why? because I hate myself :sob: :sob: :sob:)
https://github.com/kiranandcode/aoc-rhombus
Last synced: 26 days ago
JSON representation
Let's do AOC in Rhombus!!! (Why? because I hate myself :sob: :sob: :sob:)
- Host: GitHub
- URL: https://github.com/kiranandcode/aoc-rhombus
- Owner: kiranandcode
- Created: 2023-12-01T14:16:24.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2023-12-20T17:54:32.000Z (11 months ago)
- Last Synced: 2024-07-25T11:44:34.317Z (3 months ago)
- Language: Racket
- Size: 72.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# AOC in Rhombus
Let's take this thing for a ride.
It toook me friggen ages to even do day 1... The literal easiest....:
```
def result_day2:
for values(sum=0) (str: lines):
def digits: String.numeric_digits(str)
def first_digit:
def values(i, digit): String.index_of_first_digit(str)
for values(min_digit=digit):
each Pair(st, digit): digits
break_when i < st
final_when st < i
values(digit)def last_digit:
def values(i, digit): String.index_of_last_digit(str)
for values(max_digit=digit):
each Pair(st, digit): digits
skip_when st < i
values(digit)sum + String.to_number(first_digit +& last_digit)
```Want to refactor and clean up the code...