|
THẢO LUẬN XỔ SỐ - Title of your new page
|
|
|
|
|
|
/* (C)opyright: Erdogan Tan (29/9/2008)
SKORLOTO 417 6/49 Lotto Assistant Program (MS Windows & VB : 1996-2007)
Originally, it was programmed with Visual Basic 3.0 and then VB 5.0, 6.0 & VB.NET
Pardus/Linux QT4/C++ Version 1.3.1 Alpha
(Derivated from -Compatible with- SKORLOTO 417 MS Windows Version 1.2, VB 5.0 Code)
*/
#include
#include "frmSkorloto.h"
frmSkorloto::frmSkorloto(QWidget *parent) : QDialog (parent)
{
setupUi(this);
connect(cmdDraw, SIGNAL(clicked()), this, SLOT(GetRandomBall()));
}
int ball(int);
int bag[50];
bool sbag[50];
void frmSkorloto::GetRandomBall()
{
ball(0);
textLabel1->setText(QString::number(ball(1),10));
textLabel2->setText(QString::number(ball(2),10));
textLabel3->setText(QString::number(ball(3),10));
textLabel4->setText(QString::number(ball(4),10));
textLabel5->setText(QString::number(ball(5),10));
textLabel6->setText(QString::number(ball(6),10));
}
int ball(int r) {
int x = 0;
int n;
if (r) {
int y = bag[(rand()%bag[0])+1];
sbag[y] = false;
bag[0] = 0;
for (n=1; n<50; n++) {
if (sbag[n] == true) {
x += 1;
bag[x] = n;
bag[0] += 1;
}
}
return y;
}
else {
sbag[0]=true;
bag[0]=49;
for (n=1; n<50; n++) {
sbag[n]=true;
bag[n] = n;
}
return 0;
}
}
/* (C)opyright: Erdogan Tan (29/9/2008)
SKORLOTO 417 6/49 Lotto Assistant Program (MS Windows & VB : 1996-2007)
Originally, it was programmed with Visual Basic 3.0 and then VB 5.0, 6.0 & VB.NET
Pardus/Linux QT4/C++ Version 1.3.1 Alpha
(Derivated from -Compatible with- SKORLOTO 417 MS Windows Version 1.2, VB 5.0 Code)
*/
#include
#include "frmSkorloto.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
frmSkorloto *dialog = new frmSkorloto;
dialog->show();
return app.exec();
}
/* (C)opyright: Erdogan Tan (29/9/2008)
SKORLOTO 417 6/49 Lotto Assistant Program (MS Windows & VB : 1996-2007)
Originally, it was programmed with Visual Basic 3.0 and then VB 5.0, 6.0 & VB.NET
Pardus/Linux QT4/C++ Version 1.3.1 Alpha
(Derivated from -Compatible with- SKORLOTO 417 MS Windows Version 1.2, VB 5.0 Code)
*/
#ifndef FRMSKORLOTO_H
#define FRMSKORLOTO_H
#include "ui_frmSkorloto.h"
class frmSkorloto : public QDialog, public Ui::frmSkorloto
{
Q_OBJECT
public:
frmSkorloto(QWidget *parent = 0);
public slots:
void GetRandomBall();
};
#endif
|
|
|
|
|
|