Skip to content

Commit 805beac

Browse files
committed
input function
1 parent e4cb368 commit 805beac

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Core.scope

+17
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ func void println(str s) {
1515
print("\n");
1616
}
1717

18+
/%
19+
@asm
20+
21+
Returns the user input from `stdin` until a new line.
22+
The new line is not included in the final string.
23+
24+
The program will pause until the user finishes the input.
25+
%/
26+
func str input() {
27+
str o = "";
28+
assembly {
29+
call input
30+
vlist_set $o$
31+
}
32+
ret o;
33+
}
34+
1835
/%
1936
Converts @"b" into a string.
2037

0 commit comments

Comments
 (0)