|
/****************************************************************************
** ui.h extension file, included from the uic-generated form
implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
/* (C)opyright: Erdogan Tan (9/8/2007)
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 QT/C++ Version 1.3.0 Alpha
(Derivated from -Compatible with- SKORLOTO 417 MS Windows Version
1.2, VB 5.0 Code)
*/
/* Skorloto 417 for Linux C++ project files:
main.cpp, skorloto.ui (QT designer file), skorloto.ui.h (this file),
skorloto.pro (QT project file)
Run those (qmake/make) commands at command prompt/shell, in skorloto
directory:
skorloto $ qmake -o Makefile skorloto.pro
(then) skorloto $ make
(Trolltech QT 3.0 -KDE 3 development package/tool- required for compiling
this project.)
(finally, if there is no error) skorloto $ ./skorloto (to run the
program)
*/
/* Warning! Under development...
This program is an Alpha (Linux/C++ initial) version, the target of
Skorloto project:
SKORLOTO 2008 (Version 8.0) COMBINATOR (Version 6.0)
(... will be derivated from SKORLOTO 2006 COMBINATOR for MS WINDOWS,
VB 5.0 Code)
Next Stage: SKORLOTO for Linux v2.4 (Derivation from Windows v2.2
PREMIUM, VB 5.0)
Last Stage: SKORLOTO for Linux v8.0 Combinator (Derivation from
v7.3, Combinator v5.3)
*/
#include
<stdlib.h>
int ball (int);
int bag[49];
bool sbag[49];
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 (9/8/2007)
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 QT/C++ Version 1.3.0 Alpha
(Derivated from -Compatible with- SKORLOTO 417 MS Windows Version
1.2, VB 5.0 Code)
*/
#include <qapplication.h>
#include "frmskorloto.h"
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
frmSkorloto w;
w.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
} |