Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aoc 2023 solutions, days 1-3 #401

Merged
merged 10 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo apt install -y llvm-${{ matrix.llvm-version }}-dev clang-${{ matrix.llvm-version }} make valgrind
- run: LLVM_CONFIG=llvm-config-${{ matrix.llvm-version }} make
- run: ./runtests.sh --verbose './jou ${{ matrix.opt-level }} %s'
- run: ./runtests.sh --verbose './jou ${{ matrix.opt-level }} --verbose %s'
- run: ./runtests.sh --verbose 'jou ${{ matrix.opt-level }} %s'
- run: ./runtests.sh --verbose 'jou ${{ matrix.opt-level }} --verbose %s'
# Valgrinding is slow. Do it only when this file or something in the compiler has been modified.
- name: Figure out if we need to run tests with valgrind
id: check-need-valgrind
Expand All @@ -35,7 +35,7 @@ jobs:
echo doit=no >> $GITHUB_OUTPUT
fi
- if: ${{ steps.check-need-valgrind.outputs.doit == 'yes' }}
run: ./runtests.sh --verbose --valgrind './jou ${{ matrix.opt-level }} %s'
run: ./runtests.sh --verbose --valgrind 'jou ${{ matrix.opt-level }} %s'
# valgrind+verbose isn't meaningful: test script would ignore valgrind output
- run: make clean
- name: Check that "make clean" deleted all files not committed to Git
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def main() -> int:

See the [examples](./examples/) and [tests](./tests/) directories for more example programs.

So far, Jou is usable enough to do [Advent of Code 2023](https://adventofcode.com/).
We'll see whether I get 50 stars with Jou this year.
See [examples/aoc2023](./examples/aoc2023/) for the code.

Goals:
- Minimalistic feel of C + simple Python-style syntax
- Possible target audiences:
Expand Down
3 changes: 2 additions & 1 deletion compare_compilers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ for arg in "$@"; do
done

if [ ${#files[@]} = 0 ]; then
mapfile -t files < <( find stdlib examples tests -name '*.jou' | sort )
# TODO: do not skip Advent Of Code files
mapfile -t files < <( find stdlib examples tests -name '*.jou' | grep -v aoc2023 | sort )
fi
if [ ${#actions[@]} = 0 ]; then
actions=(tokenize parse run)
Expand Down
24 changes: 24 additions & 0 deletions examples/aoc2023/day01/corner-cases.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
eight3fiveninefivemtxm9eightwot
x1vzgnpdjtwonert
t3sixtwonedmj
9qzbqxmqonefiveknrnzpxoneightrq
4btqghfcqx25fivetwo95oneightxf
48sevensixfoureightwodx
15qhpvsevensixoneightt
7fiveeightoneightvs
fivesevenfour9jslninesevenjtttt7oneightssr
fivefour852eightwosx
4ssskfrfqhz9eightfour37oneightjm
25sixjrjqgl5fivekhtxstwovgxzfpvzfmoneightb
65rdlfdxjeightwox
ninercxgj4txpflzvhgtwoneqh
49seven7threeeightwokr
onetwonine4noneightvk
3eightfive88eightwor
6q9pjsdzponerfnqt6eightwob
1eightworg
8onecctzfxreighteightwoq
ptwo2fivedqxthreesdmbvdcdxrtwonegt
hdfdltsrtwoseventbqr7pckgcqtcgh8onetwonez
62xvvkpbhhbthreetwooneeightwozr
ninesevensrzxkzpmgz8kcjxsbdftwoner
Loading