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
UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|