Compare commits

..

2 Commits

Author SHA1 Message Date
kirbylife e3435d75e2 Add readme 2024-12-03 00:47:30 -06:00
kirbylife 68ccdaaadd Day 3 part 1 2024-12-03 00:47:17 -06:00
2 changed files with 41 additions and 0 deletions

13
day-3/script.sh 100644
View File

@ -0,0 +1,13 @@
#!/bin/bash
regex="mul\(([0-9]{1,3}),([0-9]{0,3}))"
acc=0
while read line; do
if [[ $line =~ $regex ]] then
n1=${BASH_REMATCH[1]}
n2=${BASH_REMATCH[2]}
acc=$(expr $n1 \* $n2 + $acc)
fi
done <<< $(grep -Eo $regex input.txt)
echo $acc

28
readme.md 100644
View File

@ -0,0 +1,28 @@
# Advent of code 2024
Cada día en un lenguaje distinto¹.
¹ aplica restricciones
- Día 1: Python
- Día 2: Zig
- Día 3: Bash
Lenguajes por usar:
1. ~Python~
1. ~Zig~
1. Golang
1. Julia
1. C++
1. PHP
1. Java
1. Ruby
1. Javascript
1. LibreOffice Calc
1. Rust
1. Nim
1. C#
1. Latino
1. D
1. ~Bash~
1. Crystal