From e669eefcee8343c8b1db621167f3b04e0579a52f Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 1 Dec 2022 18:48:22 +0100 Subject: 2022-01 in befunge! --- 2022/01/example | 1 + 2022/01/first.b98 | 7 +++++++ 2022/01/second.b98 | 8 ++++++++ 3 files changed, 16 insertions(+) create mode 100644 2022/01/first.b98 create mode 100644 2022/01/second.b98 (limited to '2022/01') diff --git a/2022/01/example b/2022/01/example index 2094f91..d0140a3 100644 --- a/2022/01/example +++ b/2022/01/example @@ -12,3 +12,4 @@ 9000 10000 + diff --git a/2022/01/first.b98 b/2022/01/first.b98 new file mode 100644 index 0000000..8cf9f88 --- /dev/null +++ b/2022/01/first.b98 @@ -0,0 +1,7 @@ +00p10p;max in 0,0, current total in 1,0;v +>#;~:a-#v_$v@,a.g00; parses a number > +^+*a\-0'< : if not an empty line, add to total and read another number +^ p01+g01_v +^ vp00< >1v +^ >v $wg00:g0< +^p01< $< diff --git a/2022/01/second.b98 b/2022/01/second.b98 new file mode 100644 index 0000000..42d901b --- /dev/null +++ b/2022/01/second.b98 @@ -0,0 +1,8 @@ +00p10p20p30p v +current total in 0,0 top3 in 1,0 2,0 and 3,0 +>#;~:a-#v_$v@,a.++g03g02g01 ; > +^+*a\-0'< : if not an empty line, add to total and read another number +^ p00+g00_v >10g00g10p00pv >20g00g20p00pv >00g30pv +^ vp01< >10g00gw> >20g00gw >30g00gw >00p + > ^ > ^ > ^ + -- cgit v1.2.3