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

+22
View File
@@ -0,0 +1,22 @@
# probe: a function returning Optional, tested and unwrapped
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: ada at 0
# expect-stdout: cy at 2
# expect-stdout: dee missing
# expect-stdout: 0 None
def index_of(xs: List[String], x: String) -> Optional[Int]:
for i in range(len(xs)):
if xs[i] == x:
return i
return None
def main():
var names: List[String] = ["ada", "bo", "cy"]
for q in ["ada", "cy", "dee"]:
var r = index_of(names, q)
if r:
print(q, "at", r.value())
else:
print(q, "missing")
print(index_of(names, "ada"), index_of(names, "zed"))