Initial commit
Test (in pplus-core) / in-core (push) Failing after 28m44s

This commit is contained in:
alexm committed 2026-11-12 22:23:48 -05:00
commit 568474d52f
1591 files changed
+528213

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
# probe: the sieve of Eratosthenes with a List[Bool]
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: 15 [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
def primes_below(n: Int) -> List[Int]:
var is_prime = List[Bool]()
for _ in range(n):
is_prime.append(True)
var out = List[Int]()
for i in range(2, n):
if is_prime[i]:
out.append(i)
var j = i * i
while j < n:
is_prime[j] = False
j += i
return out^
def main():
var ps = primes_below(50)
print(len(ps), ps)