summaryrefslogtreecommitdiff
path: root/day3/solution.TXT
blob: 52fcc0b09f40b0d839599cdde010911252968146 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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\