summaryrefslogtreecommitdiff
path: root/day4/parseln.TXT
blob: 10e6e3b20eb0c11a9f8eab4a678d63c7b0ea59ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
\START92\
\COMMENT=Converts an input line to a binary number
\NAME=parseln
\FILE=day4.parseln.92f
(s)
Func
Local l,i,c,result
0\->\result
dim(s)\->\l
For i,1,l
 mid(s,l-i+1,1)\->\c
 result*2\->\result
 If c="@" Then
  1+result\->\result
 EndIf
EndFor
result
EndFunc

\STOP92\