diff options
| author | Andreas Grois <andi@grois.info> | 2025-12-17 07:30:19 +0100 |
|---|---|---|
| committer | Andreas Grois <andi@grois.info> | 2025-12-17 07:30:19 +0100 |
| commit | dcebd44260fa67b04d217e778265982393ccc032 (patch) | |
| tree | b8eaf3de339d7a389632123c4765c53cce507a44 /day4/cntbits.TXT | |
| parent | 7c225da26c5be1c255db34b52548b3af49097b07 (diff) | |
Diffstat (limited to 'day4/cntbits.TXT')
| -rw-r--r-- | day4/cntbits.TXT | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/day4/cntbits.TXT b/day4/cntbits.TXT new file mode 100644 index 0000000..4360326 --- /dev/null +++ b/day4/cntbits.TXT @@ -0,0 +1,18 @@ +\START92\
+\COMMENT=Counts the bits set to 1 in v
+\NAME=cntbits
+\FILE=day4.cntbits.92f
+(v)
+Func
+Local r,t
+0\->\r
+While v>0
+ v/2\->\t
+ floor(t)\->\v
+ If t\!=\v Then
+ r+1\->\r
+ EndIf
+EndWhile
+EndFunc
+
+\STOP92\
|
