diff options
Diffstat (limited to 'day4/parseln.TXT')
| -rw-r--r-- | day4/parseln.TXT | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/day4/parseln.TXT b/day4/parseln.TXT new file mode 100644 index 0000000..10e6e3b --- /dev/null +++ b/day4/parseln.TXT @@ -0,0 +1,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\
|
