Accueil > > > RÉVISEZ LES TABLE DE MULTIPLICATION
RÉVISEZ LES TABLE DE MULTIPLICATION
Information sur la source
Description
Le programme sert à réviser ses table de multiplication !
Source
- {Fait par FireChris}
-
- unit Unit1;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls, Grids, Buttons, StdCtrls, Gauges, Spin, ComCtrls;
-
- type
- TForm1 = class(TForm)
- Gauge1: TGauge;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- Button1: TButton;
- StringGrid1: TStringGrid;
- Button3: TButton;
- Label1: TLabel;
- SpinEdit1: TSpinEdit;
- SpinEdit2: TSpinEdit;
- SpinEdit3: TSpinEdit;
- SpinEdit4: TSpinEdit;
- Label7: TLabel;
- Label8: TLabel;
- Timer1: TTimer;
- Button2: TButton;
- LabeledEdit1: TLabeledEdit;
- procedure FormCreate(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Timer1Timer(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
-
- private
- { Déclarations privées }
- public
-
- Procedure AfichNote;
- procedure question;
- procedure InitialGauge;
- { Déclarations publiques }
-
- end;
-
- var
- Form1: TForm1;
- nb:integer;
-
- implementation
-
- {$R *.dfm}
-
- //--------------------------------------------------------
-
- procedure Tform1.question;
- var a:integer;
- begin
-
- if (SpinEdit1.Value)>(SpinEdit2.Value)
- then begin
- a:=SpinEdit1.Value;
- SpinEdit1.Value:=SpinEdit2.Value;
- SpinEdit2.Value:=a;
- end;
-
- a:=nb;
-
- repeat
- nb:=random(SpinEdit2.Value+1);
- until (nb>=SpinEdit1.Value) and (nb<>a);
-
- a:=random(2);
-
- if a=0
- then
- Label1.Caption:=IntToStr(nb)+' * '+IntToStr(SpinEdit4.Value)
- else
- Label1.Caption:=IntToStr(SpinEdit4.Value)+' * '+IntToStr(nb);
-
- end;
-
- //--------------------------------------------------------
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- Randomize;
- end;
-
- //---------------------------------------------------------
-
- procedure TForm1.Button1Click(Sender: TObject);
- var a:integer;
- begin
-
-
-
- if Button1.Caption='Vérifier'
- then begin
-
- InitialGauge;
-
- if nb*SpinEdit4.Value=SpinEdit3.Value
- then begin
- a:=random(5);
- case a of
- 0:ShowMessage('très bien');
- 1:ShowMessage('Magnifique');
- 2:ShowMessage('Tu es le meilleur');
- 3:ShowMessage('Même moi je n''aurais pas réussi');
- 4:ShowMessage('Tu es trop bon');
- end;
- Label4.Caption:=IntToStr(StrToInt(Label4.Caption)+1);
- Label5.Caption:=IntToStr(StrToInt(Label5.Caption)+1);
- question;
- end
- else begin
- a:=random(5);
- case a of
- 0:ShowMessage('tu me déçois. '+IntToStr(nb)+' * '+InttoStr(SpinEdit4.Value)+' = '+IntToStr(nb*SpinEdit4.Value));
- 1:ShowMessage('domage. '+IntToStr(nb)+' * '+InttoStr(SpinEdit4.Value)+' = '+IntToStr(nb*SpinEdit4.Value));
- 2:ShowMessage('Tu aurais pu faire mieux. '+IntToStr(nb)+' * '+InttoStr(SpinEdit4.Value)+' = '+IntToStr(nb*SpinEdit4.Value));
- 3:ShowMessage('La prochaine fois ce sera bon. '+IntToStr(nb)+' * '+InttoStr(SpinEdit4.Value)+' = '+IntToStr(nb*SpinEdit4.Value));
- 4:ShowMessage('ça va mal. '+IntToStr(nb)+' * '+InttoStr(SpinEdit4.Value)+' = '+IntToStr(nb*SpinEdit4.Value));
- end;
- Label5.Caption:=IntToStr(StrToInt(Label5.Caption)+1);
- end
- end
- else begin
- Button1.Caption:='Vérifier';
- Button3.Enabled:=true;
- Label7.Enabled:=false;
- Label8.Enabled:=false;
- Label2.Enabled:=false;
- SpinEdit1.Enabled:=false;
- SpinEdit2.Enabled:=false;
- SpinEdit4.Enabled:=false;
- question;
- end;
-
- if label5.Caption='20'
- then begin
- Button2.Enabled:=true;
- Button1.Enabled:=false;
- Button1.Caption:='Recomencer';
- Button3.Enabled:=false;
- Label1.Caption:='';
- Label7.Enabled:=True;
- Label8.Enabled:=True;
- Label2.Enabled:=True;
- SpinEdit1.Enabled:=True;
- SpinEdit2.Enabled:=True;
- SpinEdit4.Enabled:=True;
- end
- else Timer1.Enabled:=True;
-
- end;
-
- //--------------------------------------------------
-
- procedure TForm1.Timer1Timer(Sender: TObject);
- begin
-
- Gauge1.Progress:=Gauge1.Progress+1;
-
- if Gauge1.Progress=70
- then Gauge1.ForeColor:=clYellow;
-
- if Gauge1.Progress=85
- then Gauge1.ForeColor:=clRed;
-
- if Gauge1.Progress=100
- then begin
- InitialGauge;
- Button1.Click;
- end;
-
- end;
-
- //--------------------------------------------------------
-
- procedure TForm1.Button3Click(Sender: TObject);
- begin
- Timer1.Enabled:=false;
- Gauge1.Progress:=0;
- Gauge1.ForeColor:=clLime;
- Button1.Caption:='Continuer';
- Button3.Enabled:=false;
- Label7.Enabled:=True;
- Label8.Enabled:=True;
- Label2.Enabled:=True;
- SpinEdit1.Enabled:=True;
- SpinEdit2.Enabled:=True;
- SpinEdit4.Enabled:=True;
- Label1.Caption:='';
- end;
-
- //------------------------------------------------------
-
- procedure Tform1.InitialGauge;
- Begin
- Timer1.Enabled:=False;
- Gauge1.Progress:=0;
- Gauge1.ForeColor:=clLime;
- end;
-
- //----------------------------------------------------
-
- Procedure Tform1.AfichNote;
- var a,b:integer;
- non,notebis:string;
- label ecrir;
- begin
- for a:=1 to 5 do
-
- if StringGrid1.Cells[2,a]=''
- then begin
- goto ecrir;
- end
- else begin
- if StrToInt(StringGrid1.Cells[2,a])<StrToInt(label4.Caption)
- then begin
- for b:=1 to 5-a do begin
- non:=StringGrid1.Cells[1,5-b];
- notebis:=StringGrid1.Cells[2,5-b];
- StringGrid1.Cells[1,6-b]:=non;
- StringGrid1.Cells[2,6-b]:=notebis;
- end;
- ecrir:
- StringGrid1.Cells[1,a]:=LabeledEdit1.Text;
- StringGrid1.Cells[2,a]:=label4.Caption;
- Break;
-
-
- end;
-
- end ;
- Label5.Caption:='0';
- Label4.Caption:='0';
- end;
-
-
- //------------------------------------------------------
-
-
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- AfichNote;
- Button2.Enabled:=false;
- Button1.Enabled:=true;
- end;
-
- end.
{Fait par FireChris}
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, Grids, Buttons, StdCtrls, Gauges, Spin, ComCtrls;
type
TForm1 = class(TForm)
Gauge1: TGauge;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Button1: TButton;
StringGrid1: TStringGrid;
Button3: TButton;
Label1: TLabel;
SpinEdit1: TSpinEdit;
SpinEdit2: TSpinEdit;
SpinEdit3: TSpinEdit;
SpinEdit4: TSpinEdit;
Label7: TLabel;
Label8: TLabel;
Timer1: TTimer;
Button2: TButton;
LabeledEdit1: TLabeledEdit;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Déclarations privées }
public
Procedure AfichNote;
procedure question;
procedure InitialGauge;
{ Déclarations publiques }
end;
var
Form1: TForm1;
nb:integer;
implementation
{$R *.dfm}
//--------------------------------------------------------
procedure Tform1.question;
var a:integer;
begin
if (SpinEdit1.Value)>(SpinEdit2.Value)
then begin
a:=SpinEdit1.Value;
SpinEdit1.Value:=SpinEdit2.Value;
SpinEdit2.Value:=a;
end;
a:=nb;
repeat
nb:=random(SpinEdit2.Value+1);
until (nb>=SpinEdit1.Value) and (nb<>a);
a:=random(2);
if a=0
then
Label1.Caption:=IntToStr(nb)+' * '+IntToStr(SpinEdit4.Value)
else
Label1.Caption:=IntToStr(SpinEdit4.Value)+' * '+IntToStr(nb);
end;
//--------------------------------------------------------
procedure TForm1.FormCreate(Sender: TObject);
begin
Randomize;
end;
//---------------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var a:integer;
begin
if Button1.Caption='Vérifier'
then begin
InitialGauge;
if nb*SpinEdit4.Value=SpinEdit3.Value
then begin
a:=random(5);
case a of
0:ShowMessage('très bien');
1:ShowMessage('Magnifique');
2:ShowMessage('Tu es le meilleur');
3:ShowMessage('Même moi je n''aurais pas réussi');
4:ShowMessage('Tu es trop bon');
end;
Label4.Caption:=IntToStr(StrToInt(Label4.Caption)+1);
Label5.Caption:=IntToStr(StrToInt(Label5.Caption)+1);
question;
end
else begin
a:=random(5);
case a of
0:ShowMessage('tu me déçois. '+IntToStr(nb)+' * '+InttoStr(SpinEdit4.Value)+' = '+IntToStr(nb*SpinEdit4.Value));
1:ShowMessage('domage. '+IntToStr(nb)+' * '+InttoStr(SpinEdit4.Value)+' = '+IntToStr(nb*SpinEdit4.Value));
2:ShowMessage('Tu aurais pu faire mieux. '+IntToStr(nb)+' * '+InttoStr(SpinEdit4.Value)+' = '+IntToStr(nb*SpinEdit4.Value));
3:ShowMessage('La prochaine fois ce sera bon. '+IntToStr(nb)+' * '+InttoStr(SpinEdit4.Value)+' = '+IntToStr(nb*SpinEdit4.Value));
4:ShowMessage('ça va mal. '+IntToStr(nb)+' * '+InttoStr(SpinEdit4.Value)+' = '+IntToStr(nb*SpinEdit4.Value));
end;
Label5.Caption:=IntToStr(StrToInt(Label5.Caption)+1);
end
end
else begin
Button1.Caption:='Vérifier';
Button3.Enabled:=true;
Label7.Enabled:=false;
Label8.Enabled:=false;
Label2.Enabled:=false;
SpinEdit1.Enabled:=false;
SpinEdit2.Enabled:=false;
SpinEdit4.Enabled:=false;
question;
end;
if label5.Caption='20'
then begin
Button2.Enabled:=true;
Button1.Enabled:=false;
Button1.Caption:='Recomencer';
Button3.Enabled:=false;
Label1.Caption:='';
Label7.Enabled:=True;
Label8.Enabled:=True;
Label2.Enabled:=True;
SpinEdit1.Enabled:=True;
SpinEdit2.Enabled:=True;
SpinEdit4.Enabled:=True;
end
else Timer1.Enabled:=True;
end;
//--------------------------------------------------
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Gauge1.Progress:=Gauge1.Progress+1;
if Gauge1.Progress=70
then Gauge1.ForeColor:=clYellow;
if Gauge1.Progress=85
then Gauge1.ForeColor:=clRed;
if Gauge1.Progress=100
then begin
InitialGauge;
Button1.Click;
end;
end;
//--------------------------------------------------------
procedure TForm1.Button3Click(Sender: TObject);
begin
Timer1.Enabled:=false;
Gauge1.Progress:=0;
Gauge1.ForeColor:=clLime;
Button1.Caption:='Continuer';
Button3.Enabled:=false;
Label7.Enabled:=True;
Label8.Enabled:=True;
Label2.Enabled:=True;
SpinEdit1.Enabled:=True;
SpinEdit2.Enabled:=True;
SpinEdit4.Enabled:=True;
Label1.Caption:='';
end;
//------------------------------------------------------
procedure Tform1.InitialGauge;
Begin
Timer1.Enabled:=False;
Gauge1.Progress:=0;
Gauge1.ForeColor:=clLime;
end;
//----------------------------------------------------
Procedure Tform1.AfichNote;
var a,b:integer;
non,notebis:string;
label ecrir;
begin
for a:=1 to 5 do
if StringGrid1.Cells[2,a]=''
then begin
goto ecrir;
end
else begin
if StrToInt(StringGrid1.Cells[2,a])<StrToInt(label4.Caption)
then begin
for b:=1 to 5-a do begin
non:=StringGrid1.Cells[1,5-b];
notebis:=StringGrid1.Cells[2,5-b];
StringGrid1.Cells[1,6-b]:=non;
StringGrid1.Cells[2,6-b]:=notebis;
end;
ecrir:
StringGrid1.Cells[1,a]:=LabeledEdit1.Text;
StringGrid1.Cells[2,a]:=label4.Caption;
Break;
end;
end ;
Label5.Caption:='0';
Label4.Caption:='0';
end;
//------------------------------------------------------
procedure TForm1.Button2Click(Sender: TObject);
begin
AfichNote;
Button2.Enabled:=false;
Button1.Enabled:=true;
end;
end.
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
L'INTERFACE NATURELLE DE WINDOWS PHONE 7 SERIESL'INTERFACE NATURELLE DE WINDOWS PHONE 7 SERIES par odewit
La tendance est aux interfaces naturelles (NUI), et le keynote de Bill Buxton au MIX l'a bien souligné.
La charte graphique et ergonomique de Windows Phone 7 a donc été entièrement repensée en vue d'obtenir un maximum d'efficacité sur ce point. En re...
Cliquez pour lire la suite de l'article par odewit COMMENT MAPPER UNE VUE SQL SUR UNE COLLECTION DE COMPLEX TYPE?COMMENT MAPPER UNE VUE SQL SUR UNE COLLECTION DE COMPLEX TYPE? par Matthieu MEZIL
Avec EF, les vues doivent être mappées sur des entity types. Le problème c'est que les entity types doivent avoir une clé. Avec EF, nous avons les complex type qui n'ont pas de clé mais les vues ne peuvent pas être mappées dessus. Avec EF4, il est possibl...
Cliquez pour lire la suite de l'article par Matthieu MEZIL [WF4] UN BINDING ACTIVITY/ACTIVITYDESIGNER QUI PASSE MAL?[WF4] UN BINDING ACTIVITY/ACTIVITYDESIGNER QUI PASSE MAL? par JeremyJeanson
Certain d'entre vous on peut être vécu cette situation embarrassante après quelques temps passer avec WF4 : Au début avec mon " ActivityDesigner" , tout allait bien. Et puis un jour j'ai au des problèmes de " Binding" . Alors nous sommes allé sur le site ...
Cliquez pour lire la suite de l'article par JeremyJeanson
Forum
QREPORT QREPORT par lounnaci
Cliquez pour lire la suite par lounnaci [à SUPPRIMER][à SUPPRIMER] par br1969
Cliquez pour lire la suite par br1969
Logiciels
Academy System (10.9.4.0)ACADEMY SYSTEM (10.9.4.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Xilisoft Convertisseur Vidéo Ultimate (5.1.39.0305)XILISOFT CONVERTISSEUR VIDéO ULTIMATE (5.1.39.0305)Xilisoft Convertisseur Vidéo Ultimate est un outil puissant de conversion vidéo, facile à utilise... Cliquez pour télécharger Xilisoft Convertisseur Vidéo Ultimate Xilisoft DVD Ripper Ultimate (5.0.64.0304)XILISOFT DVD RIPPER ULTIMATE (5.0.64.0304)Xilisoft DVD Ripper Ultimate est un logiciel excellent pour copier et convertir DVD vers presque ... Cliquez pour télécharger Xilisoft DVD Ripper Ultimate Rigs of Rods (63.3)RIGS OF RODS (63.3)c'est un jeu de multi-simulation camions,autobus voitures, avions, bateaux, hélicoptère avec défo... Cliquez pour télécharger Rigs of Rods
|