#include <vcl.h>
#pragma hdrstop
#include "Unit104.h"
#include <mmsystem.hpp>
#include "time.h"
int gener()
{
int x;
srand(clock());
x=1+rand()%3;
return x;
}
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int x,q,w;
if(RadioButton1->Checked)
x=1;
if(RadioButton2->Checked)
x=2;
if(RadioButton3->Checked)
x=3;
q=gener();
switch (q)
{
case 1:Label2->Caption="\n ÒÀÑ";break;
case 2:Label2->Caption="\n ÊÀÉØÛ";break;
case 3:Label2->Caption="\n ÊÀÃÀÇ";break;
}
if(x==1)
{if(q==1){Label1->Caption="\n ÒÅÍ ÎÉÛÍ";w=3;}}
if(x==2)
{if(q==2){Label1->Caption="\n ÒÅÍ ÎÉÛÍ";w=3;}}
if(x==3)
{if(q==3){Label1->Caption="\n ÒÅÍ ÎÉÛÍ";w=3;}}
if(x==1)
{if(q==2){Label1->Caption="\n ÑÛÇ ÆÅÍÄÛÍÛÇ!!!";w=2;}}
if(x==1)
{if(q==3){Label1->Caption="\n ÑÛÇ ÆÅÍÛËÄÛÍÛÇ";w=1;}}
if(x==2)
{if(q==1){Label1->Caption="\n ÑÛÇ ÆÅÍÛËÄÛÍÛÇ";w=1;}}
if(x==2)
{if(q==3){Label1->Caption="\n ÑÛÇ ÆÅÍÄÛÍÛÇ!!!";w=2;}}
if(x==3)
{if(q==1){Label1->Caption="\n ÑÛÇ ÆÅÍÄÛÍÛÇ!!!";w=2;}}
if(x==3)
{if(q==2){Label1->Caption="\n ÑÛÇ ÆÅÍÛËÄÛÍÛÇ";w=1;}}
if(w==1)
{PlaySound("1.wav", NULL, SND_ASYNC | SND_NODEFAULT);w=0;}
if(w==2)
{PlaySound("2.wav", NULL, SND_ASYNC | SND_NODEFAULT);w=0;}
if(w==3)
{PlaySound("4.wav", NULL, SND_ASYNC | SND_NODEFAULT);w=0;}
if(RadioButton1->Checked)
{
RadioButton1->Checked=false;
Button1->Enabled=false;
}
if(RadioButton2->Checked)
{
RadioButton2->Checked=false;
Button1->Enabled=false;
}
if(RadioButton3->Checked)
{
RadioButton3->Checked=false;
Button1->Enabled=false;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton1Click(TObject *Sender)
{
Button1->Enabled=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton2Click(TObject *Sender)
{
Button1->Enabled=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton3Click(TObject *Sender)
{
Button1->Enabled=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Form1->Close();
}
//---------------------------------------------------------------------------