summaryrefslogtreecommitdiff
path: root/day3/solution.TXT
diff options
context:
space:
mode:
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\