From 42d1f7bf48847c487591c2cd7edef17e346d29e2 Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Mon, 19 Sep 2022 19:59:26 +0200 Subject: [PATCH] README.org cleanup, update RESULTS.txt, build README.org with Makefile --- 2019/RESULTS.txt | 14 ++++++++++++++ 2019/day03/Makefile | 9 +++++++-- 2019/day03/README.org | 16 ++++++++++------ 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/2019/RESULTS.txt b/2019/RESULTS.txt index 1a9bc15..119045e 100644 --- a/2019/RESULTS.txt +++ b/2019/RESULTS.txt @@ -25,3 +25,17 @@ aoc-c : res=3790689 aoc-c : res=6533 time: 0:00.00 real, 0.00 user, 0.00 sys context-switch: 0+1, page-faults: 0+88 + +========================================= +================= day03 ================= +========================================= + ++++++++++++++++++ part 1 +aoc-c : res=860 + time: 0:00.00 real, 0.00 user, 0.00 sys + context-switch: 0+1, page-faults: 0+99 + ++++++++++++++++++ part 2 +aoc-c : res=9238 + time: 0:00.00 real, 0.00 user, 0.00 sys + context-switch: 0+1, page-faults: 0+98 diff --git a/2019/day03/Makefile b/2019/day03/Makefile index de8b34b..234666d 100644 --- a/2019/day03/Makefile +++ b/2019/day03/Makefile @@ -49,7 +49,7 @@ export PATH := .:$(PATH) .PHONY: clean all compile assembly memcheck memcheck1 memcheck2 ex1 ex2 -all: ex1 ex2 +all: README.org ex1 ex2 memcheck: memcheck1 @@ -71,7 +71,7 @@ ex2: aoc-c @$(TIME) aoc-c -p 2 < $(INPUT) clean: - @rm -f aoc-c core* vgcore* gmon.out aoc-c.s + @rm -f aoc-c core* vgcore* gmon.out aoc-c.s aoc-c.i README.html .c: @echo compiling $< @@ -85,3 +85,8 @@ clean: %.s: %.c @echo generating $@ @$(CC) -S -fverbose-asm $(CFLAGS) -I $(INCDIR) $< -o $@ + +# generate README.org from README.html (must cleanup !) +%.org: %.html + @echo generating $@. Cleanup before commit ! + @pandoc $< -o $@ diff --git a/2019/day03/README.org b/2019/day03/README.org index 3457ad2..aa9389b 100644 --- a/2019/day03/README.org +++ b/2019/day03/README.org @@ -55,9 +55,11 @@ is closer to the central port: its distance is =3 + 3 = 6=. Here are a few more examples: -- =R75,D30,R83,U83,L12,D49,R71,U7,L72U62,R66,U55,R34,D71,R55,D58,R83= = - distance =159= -- =R98,U47,R26,D63,R33,U87,L62,D20,R33,U53,R51U98,R91,D20,R16,D67,R40,U7,R15,U6,R7= +- =R75,D30,R83,U83,L12,D49,R71,U7,L72= + =U62,R66,U55,R34,D71,R55,D58,R83= + =distance =159= +- =R98,U47,R26,D63,R33,U87,L62,D20,R33,U53,R51= + =U98,R91,D20,R16,D67,R40,U7,R15,U6,R7= = distance =135= /What is the Manhattan distance/ from the central port to the closest @@ -102,9 +104,11 @@ However, the top-right intersection is better: the first wire takes only Here are the best steps for the extra examples from above: -- =R75,D30,R83,U83,L12,D49,R71,U7,L72U62,R66,U55,R34,D71,R55,D58,R83= = - =610= steps -- =R98,U47,R26,D63,R33,U87,L62,D20,R33,U53,R51U98,R91,D20,R16,D67,R40,U7,R15,U6,R7= +- =R75,D30,R83,U83,L12,D49,R71,U7,L72= + =U62,R66,U55,R34,D71,R55,D58,R83= + = =610= steps +- =R98,U47,R26,D63,R33,U87,L62,D20,R33,U53,R51= + =U98,R91,D20,R16,D67,R40,U7,R15,U6,R7= = =410= steps /What is the fewest combined steps the wires must take to reach an