mirror of
https://github.com/GnoConsortium/gno.git
synced 2025-01-08 17:30:14 +00:00
0b6d503134
and output files for test case comparison. See README.gno for implementation notes. NOTE: some test cases in tests/dotests are commented-out because they depend on pipes working and/or the "sort" utility.
17 lines
366 B
Plaintext
17 lines
366 B
Plaintext
assign(x, num((float)0));
|
|
assign(y, num((float)1));
|
|
while (getrec()) {
|
|
if (eval(">", field(num((float)1)), x)) {
|
|
if (eval("==", x, eval("+", y, num((float)1)))) {
|
|
assign(x, num((float)1));
|
|
assign(y, eval("*", x, num((float)2)));
|
|
} else {
|
|
print(x, array(z, x));
|
|
}
|
|
}
|
|
if (eval(">", NR, num((float)1))) {
|
|
print(field(num((float)1)));
|
|
}
|
|
}
|
|
print(NR);
|