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
[TECHDAYS2012] OUI J'Y SERAI![TECHDAYS2012] OUI J'Y SERAI! par JeremyJeanson
Bonsoir, Certes, je l'annonce avec un peu de retard, mais je serai effectivement au Techdays demain. Comme l'an dernier, je participerai au programme ATE (Ask The Expert). Si vous avez des questions Workflow, WCF, AppFabric ou plus généralement .net, n'hé...
Cliquez pour lire la suite de l'article par JeremyJeanson TFS INTEGRATION TOOLS - SUIVI DES SYNCHRONISATIONS AVEC REPORTING SERVICESTFS INTEGRATION TOOLS - SUIVI DES SYNCHRONISATIONS AVEC REPORTING SERVICES par vfabing
Afin de s'assurer du bon fonctionnement des différentes synchronisations effectuées par les TFS Integration Tools, 2 rapports sont présents dès l'installation. Il suffit alors d'effectuer les manipulations suivantes pour pouvoir les visualiser : Loca...
Cliquez pour lire la suite de l'article par vfabing CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT)CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT) par FREMYCOMPANY
Bonjour à tous, Je viens de publier une proposition comprenant 5 pseudo-classes pour le CSS Working Group ayant trait à l'état de chargement d'un élément (ex: IMG,VIDEO,AUDIO,OBJECT pour l'HTML.). Si le c½ur vous en dit, vous pouvez retrouver cette p...
Cliquez pour lire la suite de l'article par FREMYCOMPANY MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ?MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ? par ROMELARD Fabrice
Formation initiale Durant la formation, le découpage classique est le suivant (je donnerai les équivalences Suisse lorsque je les connaîtrais) : Ecole primaire jusqu'au Collège : Formation générale permettant d'obtenir les méthodes...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice Y'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENTY'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENT par Aleks
Quand on a ce genre d'erreur sans log :
Et bas on a juste envie de choper le gas de Microsoft qu'a développé ça et lui foutre des baffes de Coboye ! ...
Cliquez pour lire la suite de l'article par Aleks
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|