Advertisement
Combreal

gameselector.cpp

Mar 29th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #include "gameselector.h"
  2. #include "ui_gameselector.h"
  3.  
  4. gameselector::gameselector(QWidget *parent) :
  5.     QDialog(parent),
  6.     ui(new Ui::gameselector)
  7. {
  8.     ui->setupUi(this);
  9. }
  10.  
  11. void gameselector::f_proposer()
  12. {
  13. ui->verdict->clear();
  14. int valeurProposee = 0;
  15. smap[0]="beavercreek";
  16. smap[1]="bloodgulch";
  17. smap[2]="carousel";
  18. smap[3]="chillout";
  19. smap[4]="damnation";
  20. smap[5]="hangemhigh";
  21. smap[6]="longest";
  22. smap[7]="prisoner";
  23. smap[8]="ratrace";
  24. smap[9]="wizard";
  25. sgt[0]="ltd2_slayer";
  26. sgt[1]="ltd2_teamslayer";
  27. unsigned int a=5,b=3,m=8;
  28. unsigned int nombre = time(0);
  29. QString aAfficher;
  30. QTextStream out(&aAfficher);
  31. valeurProposee = ui->proposition->value();
  32. for(int i=0;i<valeurProposee;i++){
  33.     nombre = (a*nombre+ b) % m;
  34.     tabgt[i] = rand()%2;
  35.     out<<"sv_mapcycle_add "<<smap[nombre]<<" \""<<sgt[tabgt[i]]<<"\""<<endl;
  36. }
  37. ui->verdict->append(aAfficher);
  38. }
  39.  
  40. gameselector::~gameselector()
  41. {
  42.     delete ui;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement