This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'dart:math'; | |
main () | |
{ | |
Random r = Random (); | |
int computer = r.nextInt (11); | |
print (computer); | |
print ("please guess number"); | |
while (true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
import 'dart:io'; | |
add (int first,int second,int playeranswer) | |
{ | |
if (first + second == playeranswer) | |
{ | |
print ("you got it!"); | |
} | |
if (first + second != playeranswer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main () | |
{ | |
int computer = 7; | |
String playerstring = stdin.readLineSync(); | |
if (computer > player) | |
{ | |
print ("my number is higher"); | |
} | |
if (computer < player) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
takeoff () | |
{ | |
print ("take off"); | |
} | |
fly () | |
{ | |
takeoff (); | |
print ("flying"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'dart:math'; | |
main () | |
{ | |
Random r = Random (); | |
int computer = r.nextInt (11); | |
print ("please start guessing the number"); | |
while (true) | |
{ | |
String playerstr = stdin.readLineSync (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main () | |
{ | |
var points; | |
points = 5000; | |
print (points); | |
points = points + 100; | |
print (points); | |
points = points + 200; | |
print (points); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'dart:math'; | |
void main() { | |
runApp(new GuessNumberGame()); | |
} | |
class GuessNumberGame extends StatefulWidget { | |
@override | |
_GuessNumberState createState() => _GuessNumberState(); | |
} | |
class _GuessNumberState extends State<GuessNumberGame> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'dart:math'; | |
void main() { | |
runApp(new HelloWorld()); | |
} | |
class HelloWorld extends StatefulWidget { | |
@override | |
_HelloWorldState createState() => _HelloWorldState(); | |
} | |
class _HelloWorldState extends State<HelloWorld> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
main () | |
{ | |
runApp (HelloWorld ()); | |
} | |
class HelloWorld extends StatefulWidget | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
main () | |
{ | |
int computer = 10; | |
String playerstring = stdin.readLineSync (); | |
int player = int.parse(playerstr); | |
if (computer > player) | |
{ |