Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // import 'dart:async';
- import 'dart:math';
- import "dart:io" ;
- void main() {
- Random r = new Random();
- var tp = ["Cruzeiro", "Bahia", "Palmeiras", "Flamengo" , "Vasco" , "Santos"];
- var placar = [0,1,2,3,4,5,6];
- var retorno; //variavel do readLineSync
- print("Lista de Times Cadastrados $tp"); //Mostra os times Cadastrados
- retorno = stdin.readLineSync(); // Aperta uma tecla para prosseguir
- var time1 = tp.removeAt(r.nextInt(tp.length));
- var time2 = tp.removeAt(r.nextInt(tp.length));
- var time3 = tp.removeAt(r.nextInt(tp.length));
- var time4 = tp.removeAt(r.nextInt(tp.length));
- print("Times Participantes do Torneio $time1, $time2, $time3, $time4"); // times do torneio
- retorno = stdin.readLineSync();
- var pl1 = placar[r.nextInt(placar.length)]; // numero aleatorio do placar
- var pl2 = placar[r.nextInt(placar.length)];
- var pl3 = placar[r.nextInt(placar.length)];
- var pl4 = placar[r.nextInt(placar.length)];
- var f1;
- var f2;
- print("$time1 $pl1 x $pl2 $time2");
- if ( pl1 > pl2) {
- print("$time1 Classificado");
- time1 = f1;
- } else { pl1 < pl2;
- print("$time2 Classificado ");
- time2 = f1;
- }
- retorno = stdin.readLineSync();
- print("$time3 $pl3 x $pl4 $time4");
- if ( pl3 > pl4) {
- print("$time3 Classificado");
- time3 = f2;
- } else { pl3 < pl4;
- print("$time4 Classificado ");
- time4 = f2;
- }
- retorno = stdin.readLineSync();
- print("$f1 $f2");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement