Open utterances-bot opened 2 years ago
Basic IO demonstrating receiving and converting/casting various data-type inputs from the user:
class BasicIOTest {
static function main()
{
Sys.print("What is your name? ");
var name = Sys.stdin().readLine();
Sys.println('It\'s nice to meet you $name!');
Sys.print("How old are you? ");
var age = Std.parseInt(Sys.stdin().readLine());
Sys.print("What is your GPA? ");
var gpa = Std.parseFloat(Sys.stdin().readLine());
Sys.println('So $name, you are $age years old and your GPA is $gpa ... stellar!');
}
}
stdin, stdout, stderr - Beginner - Haxe programming language cookbook
Reading from stdin and writing to stdout and stderr.
https://code.haxe.org/category/beginner/stdin-stdout-stderr.html