Files
pplus-library/mojo/local/five-bugs.mojo
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

17 lines
504 B
Mojo

# origin: Programming+ exercise five-bugs
# status: unverified; `corpus.py verify` checks it on the pinned compiler
# probe: count the G and C bases in t; this version has mistakes to find by stepping
# expect-stdout: 1
def count_gc(t: String) -> Int:
var total: Int = 0
for i in range(t.count_codepoints() - 1):
total = 0
var b: String = String(t[codepoint=i])
if b == "G" or b == "C":
total += 1
return total
def main():
print(count_gc("GATTACA"))