Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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:)

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...