RosettaCodeData/Task/Population-count/11l/population-count.11l

15 lines
256 B
Text
Raw Permalink Normal View History

2023-07-18 13:51:12 -07:00
print((0.<30).map(i -> bits:popcount(Int64(3) ^ i)))
2023-07-01 11:58:00 -04:00
[Int] evil, odious
V i = 0
L evil.len < 30 | odious.len < 30
2023-07-18 13:51:12 -07:00
V p = bits:popcount(i)
2023-07-01 11:58:00 -04:00
I (p % 2) != 0
odious.append(i)
E
evil.append(i)
i++
print(evil[0.<30])
print(odious[0.<30])