-
Notifications
You must be signed in to change notification settings - Fork 0
/
Unit19.pas
61 lines (51 loc) · 1.47 KB
/
Unit19.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
unit Unit19;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;
type
TForm19 = class(TForm)
ScrollBox1: TScrollBox;
RadioGroup1: TRadioGroup;
RadioGroup2: TRadioGroup;
RadioGroup3: TRadioGroup;
RadioGroup4: TRadioGroup;
RadioGroup5: TRadioGroup;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form19: TForm19;
ball:integer;
type answers=array[1..5,0..2] of byte;
const otv:answers=((0,1,0),(1,0,0),(1,0,0),(0,0,1),(1,0,0));
implementation
{$R *.dfm}
uses Unit4;
procedure TForm19.Button1Click(Sender: TObject);
begin
ball:=otv[1,radiogroup1.itemIndex]+
otv[2,radiogroup2.itemIndex]+
otv[3,radiogroup3.itemIndex]+
otv[4,radiogroup4.itemIndex]+
otv[5,radiogroup5.itemIndex];
label1.Caption:='Ïðàâèëüíî îòâåòèë íà'+IntToStr(ball)+'èç 5-òè âîïðîñîâ';
if ball=5 then label2.Caption:='Ìîëîäåö! Òû îòëè÷íî óñâîèë òåðìèíû!'
else
if (ball=3) or (ball=4) then label2.Caption:='Òåáå íå ïîìåøàåò ïîâòîðèòü òåðìèíû'
else label2.Caption:='Íóæíî çàíîâî âñå ïîâòîðèòü!'
end;
procedure TForm19.Button2Click(Sender: TObject);
begin
Form4.Show;
Form19.Hide;
end;
end.