Baseline: tree as shared
This commit is contained in:
commit
659c03bbf8
1471 files changed
+990535
No files matched your search
@@ -0,0 +1,22 @@
|
||||
# probe: building strings with +, String(), join, and String(t"...") from a t-string
|
||||
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
|
||||
# expect-stdout: item1, item2, item3
|
||||
# expect-stdout: ada: 1 | bo: 3
|
||||
# expect-stdout: 0-1-4-9-16
|
||||
def label(name: String, score: Int) -> String:
|
||||
return String(t"{name}: {score}")
|
||||
|
||||
|
||||
def main():
|
||||
var parts = List[String]()
|
||||
for i in range(1, 4):
|
||||
parts.append("item" + String(i))
|
||||
var joined = String(", ").join(parts)
|
||||
print(joined)
|
||||
print(label("ada", 1), "|", label("bo", 3))
|
||||
var line = String("")
|
||||
for i in range(5):
|
||||
line += String(i * i)
|
||||
if i < 4:
|
||||
line += "-"
|
||||
print(line)
|
||||
Reference in new issue
Block a user