Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import "Ct.dart";
- import 'dart:math';
- import "dart:io" ;
- void main() {
- Random r = new Random(); //variavel Random
- var retorno; //variavel do readLineSync
- Time time1 = Time();
- time1.nome = "Flamengo";
- time1.pontos = 0;
- time1.placar = r.nextInt(6);
- Time time2 = Time();
- time2.nome = "Bahia";
- time2.pontos = 0;
- time2.placar = r.nextInt(3);
- Time time3 = Time();
- time3.nome = "Santos";
- time3.pontos = 0;
- time3.placar = r.nextInt(4);
- Time time4 = Time();
- time4.nome = "Gremio";
- time4.pontos = 0;
- time4.placar = r.nextInt(4);
- Time time5 = Time();
- time5.nome = "Cruzeiro";
- time5.pontos = 0;
- time5.placar = r.nextInt(4);
- Time time6 = Time();
- time6.nome = "Athelico PR";
- time6.pontos = 0;
- time6.placar = r.nextInt(4);
- List<Time> tp = [time1, time2,time3, time4, time5, time6];
- Time t1 = tp.removeAt(r.nextInt(tp.length));
- Time t2 = tp.removeAt(r.nextInt(tp.length));
- Time t3 = tp.removeAt(r.nextInt(tp.length));
- Time t4 = tp.removeAt(r.nextInt(tp.length));
- Time f1;
- //Time f2 =
- print("Times participantes ${t1.nome} , ${t2.nome} , ${t3.nome} ${t4.nome}");
- print("${t1.nome} ${t1.placar} x ${t2.placar} ${t2.nome}");
- if (t1.placar > t2.placar) {
- print("${t1.nome} Classificado");
- f1 = t1;
- } else {t1.placar < t2.placar;
- print("${t2.nome} Classificado ");
- f1 = t2;
- }
- retorno = stdin.readLineSync();
- //print(t1.nome);
- // print("Times Cadastrados ${tp}");
- // como imprimir todos os times sem ter que declarar 1 por um?
- // print(time1.nome);
- // print(time2.nome);
- retorno = stdin.readLineSync(); // Aperta uma tecla para prosseguir
- //print(time1.pontos);
- //time1.vitoria();
- //print(time1.pontos);
- // time1.vitoria();
- // print(time1.pontos);
- //time2.dormir();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement