1,105,386 Community Members

Help

Llama098
Newbie Poster
3 posts since Jun 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

Maybe some one can help, to make a programm, who show after some seconds random 30 numbers in massive, then they disappears and you must guess as many numbers as you can.

Member Avatar
pritaeas
mod_pritaeas
11,295 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,832 [?]
Skill Endorsements: 155 [?]
Moderator
Featured
Sponsor
 
0
 

What do you need help with? What do you have so far?

Llama098
Newbie Poster
3 posts since Jun 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

got this:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
`    Label1: TLabel;`
    Timer1: TTimer;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);


var
b:array[1..5, 1..5] of integer;
a:integer;
i:integer;
begin

Label1.Caption:=IntToStr(i);
for i := 1 to 5 do
 begin
  for a := 1 to 5 do
  begin
    b[i,a]:= 1 + random(100);
      Label1.Caption:=Label1.Caption +' ' +IntToStr(b[i,a]);
  end;
  Label1.Caption:=Label1.Caption+ #13+#10;

end;
end;
end.

Edited: now i need to after 15 seconds numbers disappear and then i write in edit text some of numbers which i remember and then check if numbers are true what i entered or not.

Member Avatar
pritaeas
mod_pritaeas
11,295 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,832 [?]
Skill Endorsements: 155 [?]
Moderator
Featured
Sponsor
 
0
 

Start the timer at the end of the label function. When it triggers, clear the label. Add an editbox to type in the numbers, and a button to verify when done.

Llama098
Newbie Poster
3 posts since Jun 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

If i know how to do it... But I will try.

Member Avatar
pritaeas
mod_pritaeas
11,295 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,832 [?]
Skill Endorsements: 155 [?]
Moderator
Featured
Sponsor
 
0
 

Tryng first is excellent, if you have specific problems/questions, post them.

Member Avatar
riki.kavadarci
Newbie Poster
4 posts since Jun 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Put Another Timer component Timer2 in to Form1
In Object Inspector
Properties

Interval =    15000   //(that is 15 second)

and

Enabled       False

Events
//On Timer
//(double click)
....
procedure TForm1.Timer2Timer(Sender: TObject);
begin
Label1.Caption:='';
Edit1.Visible:=True;
end;
....

PutEdit Component to a Form1
Set Properties

Visible   False    (in Object inspector)

OK Here is full surce code
_____________________________________________________________________

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    Timer1: TTimer;
    Timer2: TTimer;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
b:array[1..5, 1..5] of integer;
a:integer;
i:integer;
begin
Edit1.Visible:=False;
Label1.Caption:=IntToStr(i);
for i := 1 to 5 do
 begin
  for a := 1 to 5 do
  begin
    b[i,a]:= 1 + random(100);
      Label1.Caption:=Label1.Caption +' ' +IntToStr(b[i,a]);
  end;
  Label1.Caption:=Label1.Caption+ #13+#10;
  Timer2.Enabled:=True;
end;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
Label1.Caption:='';
Edit1.Visible:=True;
end;

end.

_______________________________________________________________`

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article