Skip to content

Instantly share code, notes, and snippets.

@karan-ta
Created September 13, 2020 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karan-ta/0d1015d062df97f00d4ddb2e5cf9372b to your computer and use it in GitHub Desktop.
Save karan-ta/0d1015d062df97f00d4ddb2e5cf9372b to your computer and use it in GitHub Desktop.
import 'dart:math';
import 'dart:io';
main ()
{
Random r = Random ();
int computer = r.nextInt (11);
String playerstr = stdin.readLineSync();
int player = int.parse (playerstr);
if (computer > player)
{
print ("my number is higher");
}
if (computer < player)
{
print ("my number is lower");
}
if (computer == player)
{
print ("you got it");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment