Advertisement
Guest User

Untitled

a guest
May 20th, 2019
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.86 KB | None | 0 0
  1.  
  2.  
  3. import "Ct.dart";
  4. import 'dart:math';
  5. import "dart:io" ;
  6.  
  7. void main() {
  8. Random r = new Random(); //variavel Random
  9. var retorno;   //variavel do readLineSync
  10.  
  11.   Time time1 = Time();
  12.   time1.nome = "Flamengo";
  13.   time1.pontos = 0;
  14.   time1.placar = r.nextInt(6);
  15.  
  16.  
  17.   Time time2 = Time();
  18.   time2.nome = "Bahia";
  19.   time2.pontos = 0;
  20.   time2.placar = r.nextInt(3);
  21.  
  22.   Time time3 = Time();
  23.   time3.nome = "Santos";
  24.   time3.pontos = 0;
  25.   time3.placar = r.nextInt(4);
  26.  
  27.   Time time4 = Time();
  28.   time4.nome = "Gremio";
  29.   time4.pontos = 0;
  30.   time4.placar = r.nextInt(4);
  31.  
  32.   Time time5 = Time();
  33.   time5.nome = "Cruzeiro";
  34.   time5.pontos = 0;
  35.   time5.placar = r.nextInt(4);
  36.  
  37.   Time time6 = Time();
  38.   time6.nome = "Athelico PR";
  39.   time6.pontos = 0;
  40.   time6.placar = r.nextInt(4);
  41.  
  42.  
  43.  
  44.  
  45.   List<Time> tp = [time1, time2,time3, time4, time5, time6];
  46.   Time t1 = tp.removeAt(r.nextInt(tp.length));
  47.   Time t2 = tp.removeAt(r.nextInt(tp.length));
  48.   Time t3 = tp.removeAt(r.nextInt(tp.length));
  49.   Time t4 = tp.removeAt(r.nextInt(tp.length));
  50.  
  51.   Time f1;
  52.   //Time f2 =
  53.   print("Times participantes ${t1.nome} , ${t2.nome} , ${t3.nome} ${t4.nome}");
  54.  
  55.  
  56.  
  57.    print("${t1.nome} ${t1.placar} x ${t2.placar} ${t2.nome}");
  58.    if (t1.placar > t2.placar) {
  59.       print("${t1.nome} Classificado");
  60.       f1 = t1;
  61.    } else {t1.placar < t2.placar;
  62.       print("${t2.nome} Classificado ");
  63.       f1 = t2;
  64.    }
  65.   retorno = stdin.readLineSync();
  66.  
  67.  
  68.  
  69.   //print(t1.nome);
  70.  
  71.  // print("Times Cadastrados ${tp}");
  72.   // como imprimir todos os times sem ter que declarar 1 por um?
  73.   // print(time1.nome);
  74.   // print(time2.nome);
  75.   retorno = stdin.readLineSync(); // Aperta uma tecla para prosseguir
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  //print(time1.pontos);
  82.  //time1.vitoria();
  83.  //print(time1.pontos);
  84.  // time1.vitoria();
  85.  // print(time1.pontos);
  86.  
  87.   //time2.dormir();
  88.  
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement