21 lines
474 B
Plaintext
21 lines
474 B
Plaintext
|
|
// Phase 190: Number accumulation test - parse number implementation
|
||
|
|
// Tests: num = num * 10 + i pattern with different initial values
|
||
|
|
// Uses Pattern 2 (break) to enable carrier support
|
||
|
|
|
||
|
|
static box ParseNumberImpl {
|
||
|
|
method main() {
|
||
|
|
local num
|
||
|
|
num = 0
|
||
|
|
local i
|
||
|
|
i = 1
|
||
|
|
loop(i < 10) {
|
||
|
|
if i > 3 {
|
||
|
|
break
|
||
|
|
}
|
||
|
|
num = num * 10 + i
|
||
|
|
i = i + 1
|
||
|
|
}
|
||
|
|
print(num)
|
||
|
|
}
|
||
|
|
}
|