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

18 lines
520 B
Mojo

# probe: comptime constants and expressions used at run time
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: 8 4 32
# expect-stdout: #.#.#.#.
# expect-stdout: hi!
comptime WIDTH = 8
comptime HEIGHT = WIDTH // 2
comptime GREETING = "hi"
def main():
print(WIDTH, HEIGHT, WIDTH * HEIGHT)
var row = String("")
for x in range(WIDTH):
row += "#" if x % 2 == 0 else "."
print(row)
print(GREETING + "!")