summaryrefslogtreecommitdiff
path: root/day3/solution.TXT
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2025-12-05 00:06:58 +0100
committerAndreas Grois <andi@grois.info>2025-12-05 00:06:58 +0100
commit1e4324fc92b863de1f52e4c5a7f2a45c4c0289fb (patch)
tree806fd7b80e7d247e12049fb2e0e399acb9672154 /day3/solution.TXT
parent1edd26243bde242f0de78c947c94cf3d73e6070b (diff)
Day 3
Diffstat (limited to 'day3/solution.TXT')
-rw-r--r--day3/solution.TXT31
1 files changed, 31 insertions, 0 deletions
diff --git a/day3/solution.TXT b/day3/solution.TXT
new file mode 100644
index 0000000..52fcc0b
--- /dev/null
+++ b/day3/solution.TXT
@@ -0,0 +1,31 @@
+\START92\
+\COMMENT=Single file dated Fri Dec 5 00:04:24 20
+\NAME=solution
+\FILE=day3.solution.92f
+(s,l)
+Func
+Local ds,p1,p2,curr,result
+0\->\result
+1\->\p1
+dim(s)\->\ds
+While p1\<=\ds
+ inString(s," ",p1)\->\p2
+ If p2\<=\0 Then
+ mid(s,p1)\->\curr
+ ds+1\->\p2
+ ElseIf p2=p1 Then
+ p1+1\->\p1
+ Goto continue
+ Else
+ mid(s,p1,p2-p1)\->\curr
+ EndIf
+ p2\->\p1
+
+ result+maxj(curr,l)\->\result
+ Lbl continue
+EndWhile
+
+Return result
+EndFunc
+
+\STOP92\