Skip to content

Instantly share code, notes, and snippets.

@VB10
Created July 7, 2020 12:00
Show Gist options
  • Select an option

  • Save VB10/2b5404838cf6831c13a5123e72d6a35d to your computer and use it in GitHub Desktop.

Select an option

Save VB10/2b5404838cf6831c13a5123e72d6a35d to your computer and use it in GitHub Desktop.
Dart Read Character
import 'dart:convert';
import 'dart:io';
main() {
print('1 + 1 = ...');
var line = stdin.readLineSync(encoding: Encoding.getByName('utf-8'));
print(line.trim() == '2' ? 'Yup!' : 'Nope :(');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment