initial import

This commit is contained in:
Steffen Vogel 2010-08-17 01:23:08 +02:00
commit bc42f5755e
33 changed files with 1151 additions and 0 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
.settings
.cproject
.project
.classpath

BIN
BadResult.wav Executable file

Binary file not shown.

BIN
Bilder/image002.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

BIN
Bilder/image004.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

BIN
Bilder/image006.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

BIN
Bilder/image008.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
Bilder/image010.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
Bilder/image012.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
Bilder/image014.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
GoodResult.wav Executable file

Binary file not shown.

BIN
Potenz.GID Executable file

Binary file not shown.

110
Potenz.aip Executable file
View file

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DOCUMENT type="Advanced Installer" version="2.2" modules="freeware" RootPath=".">
<COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent">
<ROW Property="ALLUSERS" Value="2"/>
<ROW Property="ARPHELPLINK" Value="http://steffenvogel.de/"/>
<ROW Property="ARPNOMODIFY" Value="1"/>
<ROW Property="ARPNOREPAIR" Value="1"/>
<ROW Property="ARPPRODUCTICON" Value="controlPanelIcon.exe"/>
<ROW Property="ARPURLINFOABOUT" Value="http://steffenvogel.de/stff/Programmieren/Delphi/Potenz/Ranking/"/>
<ROW Property="ARPURLUPDATEINFO" Value="http://steffenvogel.de/stff/Programmieren/Delphi/Potenz/Ranking/"/>
<ROW Property="BannerBitmap" Value="default_banner.bmp"/>
<ROW Property="DialogBitmap" Value="default_dialog.bmp"/>
<ROW Property="Manufacturer" Value="Steffen Vogel, Lucas Baier, Benedikt Lauer"/>
<ROW Property="ProductCode" Value="{054F3E9D-2D76-4589-BD90-4B814D5E5086}"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="Potenzübungsprogramm"/>
<ROW Property="ProductVersion" Value="3.3"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
<ROW Property="UpgradeCode" Value="{F5843571-42E1-43F0-8F85-461011D90968}"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiDirsComponent">
<ROW Directory="DesktopFolder" Directory_Parent="TARGETDIR" DefaultDir="Deskto~1|DesktopFolder" IsPseudoRoot="1"/>
<ROW Directory="Quelltext_DIR" Directory_Parent="SHORTCUTDIR" DefaultDir="Quellt~1|Quelltext"/>
<ROW Directory="SHORTCUTDIR" Directory_Parent="TARGETDIR" DefaultDir="SHORTC~1|SHORTCUTDIR" IsPseudoRoot="1"/>
<ROW Directory="TARGETDIR" Directory_Parent="" DefaultDir="SourceDir"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
<ROW Component="Potenz.exe" ComponentId="{137E8EB5-1A97-4663-8669-89983CF3E47D}" Directory_="TARGETDIR" Attributes="0" Condition="" KeyPath="Potenz.exe" FullKeyPath="TARGETDIR\Potenz.exe"/>
<ROW Component="Potenz.hlp" ComponentId="{AA156AC4-8E58-4B0C-8640-247F0670607F}" Directory_="TARGETDIR" Attributes="0" Condition="" KeyPath="Potenz.hlp" FullKeyPath="TARGETDIR\Potenz.hlp"/>
<ROW Component="Potenz.hlp_1" ComponentId="{1A4879A8-A413-4399-BAED-B3C065123239}" Directory_="Quelltext_DIR" Attributes="0" Condition="" KeyPath="Potenz.hlp_1" FullKeyPath="SHORTCUTDIR\Quelltext\Potenz.hlp"/>
<ROW Component="Right.wav" ComponentId="{5122887A-42A8-4EB7-9945-0385F1075991}" Directory_="TARGETDIR" Attributes="0" Condition="" KeyPath="Right.wav" FullKeyPath="TARGETDIR"/>
<ROW Component="Unit3.dfm" ComponentId="{561D9A6C-B07A-4BB1-8AD6-33C327A73B53}" Directory_="Quelltext_DIR" Attributes="0" Condition="" KeyPath="Unit3.dfm" FullKeyPath="SHORTCUTDIR\Quelltext"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">
<ROW Feature="MainFeature" Feature_Parent="" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="TARGETDIR" Attributes="0" Components="Right.wav Potenz.hlp Unit3.dfm Potenz.hlp_1 Potenz.exe"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">
<ROW File="BadResult.wav" Component_="Right.wav" FileName="BadRes~1.wav|BadResult.wav" Version="" Language="" Attributes="0" SourcePath="BadResult.wav" SelfReg="false"/>
<ROW File="BadResult.wav_1" Component_="Unit3.dfm" FileName="BadRes~1.wav|BadResult.wav" Version="" Language="" Attributes="0" SourcePath="BadResult.wav" SelfReg="false"/>
<ROW File="GoodResult.wav" Component_="Right.wav" FileName="GoodRe~1.wav|GoodResult.wav" Version="" Language="" Attributes="0" SourcePath="GoodResult.wav" SelfReg="false"/>
<ROW File="GoodResult.wav_1" Component_="Unit3.dfm" FileName="GoodRe~1.wav|GoodResult.wav" Version="" Language="" Attributes="0" SourcePath="GoodResult.wav" SelfReg="false"/>
<ROW File="Potenz.GID" Component_="Unit3.dfm" FileName="Potenz.GID" Version="" Language="" Attributes="0" SourcePath="Potenz.GID" SelfReg="false"/>
<ROW File="Potenz.aip" Component_="Unit3.dfm" FileName="Potenz.aip" Version="" Language="" Attributes="0" SourcePath="Potenz.aip" SelfReg="false"/>
<ROW File="Potenz.cfg" Component_="Unit3.dfm" FileName="Potenz.cfg" Version="" Language="" Attributes="0" SourcePath="Potenz.cfg" SelfReg="false"/>
<ROW File="Potenz.cnt" Component_="Potenz.hlp" FileName="Potenz.cnt" Version="" Language="" Attributes="0" SourcePath="Potenz.cnt" SelfReg="false"/>
<ROW File="Potenz.dof" Component_="Unit3.dfm" FileName="Potenz.dof" Version="" Language="" Attributes="0" SourcePath="Potenz.dof" SelfReg="false"/>
<ROW File="Potenz.dpr" Component_="Unit3.dfm" FileName="Potenz.dpr" Version="" Language="" Attributes="0" SourcePath="Potenz.dpr" SelfReg="false"/>
<ROW File="Potenz.exe" Component_="Potenz.exe" FileName="Potenz.exe" Version="" Language="" Attributes="0" SourcePath="Potenz.exe" SelfReg="false"/>
<ROW File="Potenz.hlp" Component_="Potenz.hlp" FileName="Potenz.hlp" Version="" Language="" Attributes="0" SourcePath="Potenz.hlp" SelfReg="false"/>
<ROW File="Potenz.hlp_1" Component_="Potenz.hlp_1" FileName="Potenz.hlp" Version="" Language="" Attributes="0" SourcePath="Potenz.hlp" SelfReg="false"/>
<ROW File="Potenz.ico" Component_="Unit3.dfm" FileName="Potenz.ico" Version="" Language="" Attributes="0" SourcePath="Potenz.ico" SelfReg="false"/>
<ROW File="Potenz.res" Component_="Unit3.dfm" FileName="Potenz.res" Version="" Language="" Attributes="0" SourcePath="Potenz.res" SelfReg="false"/>
<ROW File="Potenz.sh5" Component_="Unit3.dfm" FileName="Potenz.sh5" Version="" Language="" Attributes="0" SourcePath="Potenz.sh5" SelfReg="false"/>
<ROW File="Right.wav" Component_="Right.wav" FileName="Right.wav" Version="" Language="" Attributes="0" SourcePath="Right.wav" SelfReg="false"/>
<ROW File="Right.wav_1" Component_="Unit3.dfm" FileName="Right.wav" Version="" Language="" Attributes="0" SourcePath="Right.wav" SelfReg="false"/>
<ROW File="Unit1.dcu" Component_="Unit3.dfm" FileName="Unit1.dcu" Version="" Language="" Attributes="0" SourcePath="Unit1.dcu" SelfReg="false"/>
<ROW File="Unit1.dfm" Component_="Unit3.dfm" FileName="Unit1.dfm" Version="" Language="" Attributes="0" SourcePath="Unit1.dfm" SelfReg="false"/>
<ROW File="Unit1.pas" Component_="Unit3.dfm" FileName="Unit1.pas" Version="" Language="" Attributes="0" SourcePath="Unit1.pas" SelfReg="false"/>
<ROW File="Unit2.dcu" Component_="Unit3.dfm" FileName="Unit2.dcu" Version="" Language="" Attributes="0" SourcePath="Unit2.dcu" SelfReg="false"/>
<ROW File="Unit2.dfm" Component_="Unit3.dfm" FileName="Unit2.dfm" Version="" Language="" Attributes="0" SourcePath="Unit2.dfm" SelfReg="false"/>
<ROW File="Unit2.pas" Component_="Unit3.dfm" FileName="Unit2.pas" Version="" Language="" Attributes="0" SourcePath="Unit2.pas" SelfReg="false"/>
<ROW File="Unit3.dcu" Component_="Unit3.dfm" FileName="Unit3.dcu" Version="" Language="" Attributes="0" SourcePath="Unit3.dcu" SelfReg="false"/>
<ROW File="Unit3.dfm" Component_="Unit3.dfm" FileName="Unit3.dfm" Version="" Language="" Attributes="0" SourcePath="Unit3.dfm" SelfReg="false"/>
<ROW File="Unit3.pas" Component_="Unit3.dfm" FileName="Unit3.pas" Version="" Language="" Attributes="0" SourcePath="Unit3.pas" SelfReg="false"/>
<ROW File="Wrong.wav" Component_="Right.wav" FileName="Wrong.wav" Version="" Language="" Attributes="0" SourcePath="Wrong.wav" SelfReg="false"/>
<ROW File="Wrong.wav_1" Component_="Unit3.dfm" FileName="Wrong.wav" Version="" Language="" Attributes="0" SourcePath="Wrong.wav" SelfReg="false"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiBinaryComponent">
<ROW Name="default_banner.bmp" SourcePath="&lt;default-banner.bmp&gt;"/>
<ROW Name="default_dialog.bmp" SourcePath="&lt;default-dialog.bmp&gt;"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiCustActComponent">
<ROW Action="AI_DOWNGRADE" Type="19" Source="" Target="A higher version of [ProductName] is installed."/>
<ROW Action="SET_SHORTCUTDIR" Type="307" Source="SHORTCUTDIR" Target="[ProgramMenuFolder][ProductName]"/>
<ROW Action="SET_TARGETDIR" Type="307" Source="TARGETDIR" Target="[ProgramFilesFolder]\[ProductName]"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiIconsComponent">
<ROW Name="SystemFolder_msiexec.exe" SourcePath="&lt;uninstall.ico&gt;" Index="0"/>
<ROW Name="controlPanelIcon.exe" SourcePath="Potenz.ico" Index="0"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstExSeqComponent">
<ROW Action="AI_DOWNGRADE" Condition="AI_NEWERPRODUCTFOUND AND (UILevel &lt;&gt; 5)" Sequence="210"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstallUISequenceComponent">
<ATTRIBUTE name="End" value="ExitDialog"/>
<ATTRIBUTE name="Progress" value="ProgressDlg"/>
<ATTRIBUTE name="Start" value="WelcomeDlg FolderDlg VerifyReadyDlg"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiMediaComponent">
<ATTRIBUTE name="Compress" value="1"/>
<ATTRIBUTE name="FirstMediaSize" value="0"/>
<ATTRIBUTE name="FirstMediaSizeUnit" value="0"/>
<ATTRIBUTE name="InstallationType" value="0"/>
<ATTRIBUTE name="MediaSize" value="0"/>
<ATTRIBUTE name="MediaSizeUnit" value="0"/>
<ATTRIBUTE name="Package" value="1"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiShortsComponent">
<ROW Shortcut="Hilfe" Directory_="SHORTCUTDIR" Name="Hilfe" Component_="Potenz.hlp" Target="[#Potenz.hlp]" Arguments="" Description="" Hotkey="0" Icon_="" IconIndex="0" ShowCmd="1" WkDir=""/>
<ROW Shortcut="Potenz_bungsprogramm" Directory_="SHORTCUTDIR" Name="Potenz~1|Potenzübungsprogramm" Component_="Potenz.exe" Target="[#Potenz.exe]" Arguments="" Description="" Hotkey="0" Icon_="" IconIndex="0" ShowCmd="1" WkDir="TARGETDIR"/>
<ROW Shortcut="Potenz_bungsprogramm_1" Directory_="DesktopFolder" Name="Potenz~1|Potenzübungsprogramm" Component_="Potenz.exe" Target="[#Potenz.exe]" Arguments="" Description="" Hotkey="0" Icon_="" IconIndex="0" ShowCmd="1" WkDir="TARGETDIR"/>
<ROW Shortcut="Uninstall" Directory_="SHORTCUTDIR" Name="Uninst~1|Uninstall" Component_="Potenz.hlp" Target="[SystemFolder]msiexec.exe" Arguments="/x [ProductCode]" Description="" Hotkey="0" Icon_="SystemFolder_msiexec.exe" IconIndex="0" ShowCmd="1" WkDir=""/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiUpgradeComponent">
<ROW UpgradeCode="UpgradeCode" VersionMin="" VersionMax="ProductVersion" Language="" Attributes="1025" Remove=""/>
<ROW UpgradeCode="UpgradeCode" VersionMin="ProductVersion" VersionMax="" Language="" Attributes="2" Remove=""/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.PreReqComponent">
</COMPONENT>
</DOCUMENT>

34
Potenz.cfg Executable file
View file

@ -0,0 +1,34 @@
-$A+
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J+
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-LNc:\programme\borland\delphi4\Lib

44
Potenz.cnt Executable file
View file

@ -0,0 +1,44 @@
:Base potenz.hlp
1 Willkommen!=willkommen>Main
1 Funktionsübersicht=funktionsübersicht>Main
1 Lizenz=lizenz>Main
1 Bedienung
2 Menü
3 Datei
4 Neue Übung starten=neueübungstarten>Main
4 Auswerten=auswerten>Main
4 Beenden=beenden>Main
3 Optionen
4 Negative Exponenten=negativeexponenten>Main
4 Zahlenbereich=zahlenbereich>Main
4 Aufgaben=aufgaben>Main
4 Ganzzahlige Ergebnisse=ganzzahligeergebnisse>Main
4 Sounds=sounds>Main
4 Zeit anzeigen=zeitanzeigen>Main
3 ?
4 Internet Ranking=internetranking>Main
4 Hilfe=hilfe>Main
4 Über=über>Main
2 Buttons
3 Hauptfenster
4 Überprüfen=überprüfen>Main
4 Weiter=weiter>Main
4 Rechner=rechner>Main
3 Zusammenfassung
4 Ergebnisse übertragen=ergebnisseübertragen>Main
4 Schließen=schließen>Main
3 Über Dialog
4 Schließen=about_schließen>Main
4 GPL=gpl>Main
2 Eingabefelder
3 Basis=basis>Main
3 Exponent=exponent>Main
2 Tastatur=tastatur>Main
1 Funktionen
2 Internet Ranking=funktion:internetranking>Main
2 Soundausgabe=soundausgabe>Main
1 Potenzgesetze
2 gleiche Basis=gleichebasis>Main
2 gleicher Exponent=gleicherexponent>Main
2 Potenz einer Potenz=potenzeinerpotenz>Main

78
Potenz.dof Executable file
View file

@ -0,0 +1,78 @@
[Compiler]
A=1
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=1
K=0
L=1
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=Potenzübungsprogramm
[Directories]
OutputDir=
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
Packages=Vcl40;Vclx40;Vcldb40;vcldbx40;VclSmp40;Qrpt40
Conditionals=
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1031
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=

19
Potenz.dpr Executable file
View file

@ -0,0 +1,19 @@
program Potenz;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2},
Unit3 in 'Unit3.pas' {Form3};
{$R *.RES}
begin
Application.Initialize;
Application.Title := 'Potenzübungsprogramm';
Application.HelpFile := 'Potenz.hlp';
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.CreateForm(TForm3, Form3);
Application.Run;
end.

BIN
Potenz.exe Executable file

Binary file not shown.

BIN
Potenz.hlp Executable file

Binary file not shown.

BIN
Potenz.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
Potenz.msi Executable file

Binary file not shown.

BIN
Potenz.res Executable file

Binary file not shown.

BIN
Potenz.sh5 Executable file

Binary file not shown.

BIN
Right.wav Executable file

Binary file not shown.

BIN
Unit1.dcu Executable file

Binary file not shown.

BIN
Unit1.dfm Executable file

Binary file not shown.

738
Unit1.pas Executable file
View file

@ -0,0 +1,738 @@
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, ComCtrls, StdCtrls, Math, CommCtrl, ShellApi, MMSystem, ExtCtrls;
type
TForm1 = class(TForm)
StatusBar: TStatusBar;
MnuMain: TMainMenu;
MnuArt: TMenuItem;
MnuPotenzeinerPotenz: TMenuItem;
MnuGleicheBasis: TMenuItem;
MnuGleicherExponent: TMenuItem;
MnuHelp: TMenuItem;
MnuBeenden: TMenuItem;
MnuOptionen: TMenuItem;
MnuNeuebung: TMenuItem;
MnuAuswerten: TMenuItem;
TxtSolBas: TEdit;
TxtSolExp: TEdit;
LblExOp2Bas: TLabel;
LblExOp2Exp: TLabel;
BtnSubmit: TButton;
LblEqual: TLabel;
LblExOp1Bas: TLabel;
LblExOp1Exp: TLabel;
LblExOp1ExpExp: TLabel;
LblOp: TLabel;
LblBrackets: TLabel;
BtnNextEx: TButton;
NegativeExponenten1: TMenuItem;
Zahlenbereich1: TMenuItem;
Aufgaben1: TMenuItem;
ProgressBarExRight: TProgressBar;
Zufaellig1: TMenuItem;
Round1: TMenuItem;
StatusBarInstruction: TStatusBar;
ProgressBarEx: TProgressBar;
Ueber1: TMenuItem;
InternetRanking1: TMenuItem;
Hilfe1: TMenuItem;
Timer: TTimer;
Sounds1: TMenuItem;
Zeitanzeigen1: TMenuItem;
BtnCalc: TButton;
LblWelcome: TLabel;
procedure MnuGleicherExponentClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure BtnSubmitClick(Sender: TObject);
procedure MnuPotenzeinerPotenzClick(Sender: TObject);
procedure MnuGleicheBasisClick(Sender: TObject);
procedure BtnNextExClick(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure NegativeExponenten1Click(Sender: TObject);
procedure Aufgaben1Click(Sender: TObject);
procedure Zahlenbereich1Click(Sender: TObject);
procedure MnuBeendenClick(Sender: TObject);
procedure Zufaellig1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure MnuAuswertenClick(Sender: TObject);
procedure InternetRanking1Click(Sender: TObject);
procedure Round1Click(Sender: TObject);
procedure TimerTimer(Sender: TObject);
procedure Hilfe1Click(Sender: TObject);
procedure Ueber1Click(Sender: TObject);
procedure Sounds1Click(Sender: TObject);
procedure Zeitanzeigen1Click(Sender: TObject);
procedure BtnCalcClick(Sender: TObject);
private
{ Private-Deklarationen}
public
{ Public-Deklarationen}
end;
procedure GleicheBasis;
procedure GleicherExponent;
procedure PotenzeinerPotenz;
procedure ExRandom;
procedure UpdateCounter;
procedure ResetDisplay;
procedure Reset;
function SolRound(value: double; dcpoint: integer): double;
var
Form1: TForm1;
ExType: Integer;
{0= Keine Übung
1= Gleicher Exponent
2= Gleiche Basis
3= Potenz einer Potenz}
Flag: Boolean; // Richtig oder Falsch?
RanFlag: Boolean; // Zufallsübung?
TimeFlag: Boolean; // Zeit anzeigen?
RoundFlag: Boolean; // ganzzahlige Ergebnisse oder Runden?
NegFlag: Boolean;
SoundFlag: Boolean;
Op: Integer;
{0= /(geteilt)
1= x (mal)}
SolBas: Integer; // zum Errechnen ganzzahliger Lösungen
Sol: Real; // Lösungen
Op1: Integer; // Operant 1
Op2: Integer; // Operant 2
Op3: String;
Constants: Array[1..6] of String;
RangeMax, RangeMin: Integer; // Zahlenbereich
ExMax: Integer; // Wieviele Aufgaben?
Ex: Integer; // Aktuelle Aufgabe
ExRight: Integer; // richtige Aufgaben
ExWrong: Integer; // falsche Aufgaben
TransName: String; // Name für Online Ranking
TransComment: String; // Kommentar für Online Ranking
r: TRect;
s: TRect;
StartTime, TotalTime: Cardinal; // für den Timer
const
MainUrl = 'http://steffenvogel.de/stff/Programmieren/Delphi/Potenz/Ranking/index.php';
SoundRight = 'Right.wav';
SoundWrong = 'Wrong.wav';
SoundBadResult = 'BadResult.wav';
SoundGoodResult = 'GoodResult.wav';
implementation
uses Unit2, Unit3;
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
randomize;
RoundFlag := False;
TimeFlag := True;
NegFlag := True;
SoundFlag := True;
Flag := False;
RangeMax := 20;
RangeMin := -20;
ExMax := 20;
Constants[1] := 'a';
Constants[2] := 'b';
Constants[3] := 'c';
Constants[4] := 'x';
Constants[5] := 'y';
Constants[6] := 'z';
ExType := 0;
//RanFlag := True; // eventuell auskommentieren
if ExType <> 0 then
begin
StartTime := GetTickCount;
end;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
StatusBar.Perform(SB_GETRECT, 1, integer(@R));
ProgressBarEx.Parent := StatusBar;
ProgressBarEx.BoundsRect := r;
StatusBar.Perform(SB_GETRECT, 3, integer(@S));
ProgressBarExRight.Parent := StatusBar;
ProgressBarExRight.BoundsRect := s;
Form1.BtnNextExClick(Sender);
end;
function SolRound(value: double; dcpoint: integer): double;
var Multi: Double;
begin
Multi:= IntPower(10, dcpoint);
Value:= Round(Value * Multi);
Result:= Value / Multi;
end;
procedure UpdateCounter;
begin
if ExType <> 0 then
begin
try
Form1.StatusBar.Panels[0].Text := inttostr(Ex) + '/' + inttostr(ExMax) + ' (' + inttostr(Round((Ex / ExMax)*100)) + '%)';
Form1.ProgressbarEx.Max := ExMax;
Form1.ProgressbarEx.Position := Ex;
Form1.StatusBar.Panels[2].Text := inttostr(ExRight) + '/' + inttostr(Ex) + ' (' + inttostr(Round((ExRight / Ex)*100)) + '%)';
Form1.ProgressbarExRight.Max := Ex;
Form1.ProgressbarExRight.Position := ExRight;
except
//on EZeroDivide do
// begin
Form1.StatusBar.Panels[2].Text := inttostr(ExRight) + '/' + inttostr(Ex) + ' (0%)';
Form1.StatusBar.Panels[0].Text := inttostr(Ex) + '/' + inttostr(ExMax) + ' (0%)';
// end;
end;
end;
end;
procedure ResetDisplay;
begin
Form1.LblExOp1Bas.Visible := False;
Form1.LblExOp1Exp.Visible := False;
Form1.LblExOp1ExpExp.Visible := False;
Form1.LblExOp2Bas.Visible := False;
Form1.LblExOp2Exp.Visible := False;
Form1.LblBrackets.Visible := False;
Form1.LblEqual.Visible := False;
Form1.LblOp.Visible := False;
Form1.TxtSolBas.Font.Color := clBlack;
Form1.TxtSolExp.Font.Color := clBlack;
Form1.BtnSubmit.Visible := False;
Form1.BtnNextEx.Visible := False;
Form1.BtnCalc.Visible := False;
Form1.TxtSolBas.Visible := False;
Form1.TxtSolExp.Visible := False;
Form1.LblWelcome.Visible := False;
Form1.TxtSolBas.ReadOnly := False;
Form1.TxtSolExp.ReadOnly := False;
Form1.LblExOp1Exp.Caption := '';
Form1.LblExOp2Exp.Caption := '';
Form1.LblExOp1Bas.Caption := '';
Form1.LblExOp2Bas.Caption := '';
Form1.StatusBarInstruction.Panels[0].Text := '';
Form1.StatusBarInstruction.Panels[1].Text := '';
Form1.StatusBar.Panels[0].Text := '';
Form1.StatusBar.Panels[2].Text := '';
Form1.TxtSolBas.Text := '';
Form1.TxtSolExp.Text := '';
Flag := False;
Form1.ProgressbarExRight.Max := 100;
Form1.ProgressbarExRight.Position := 0;
Form1.ProgressbarEx.Max := 100;
Form1.ProgressbarEx.Position := 0;
end;
procedure Reset;
begin
ResetDisplay;
Form1.LblWelcome.Visible := True;
RanFlag := False;
Form1.StatusBarInstruction.Panels[0].Text := 'Wählen Sie bitte eine Übung aus!';
ExType := 0;
Ex := 0;
ExRight := 0;
StartTime := 0;
TotalTime := 0;
end;
procedure GleicherExponent;
begin
ResetDisplay;
Op := Random(2);
Op1 := Random(RangeMax-RangeMin)+RangeMin;
Op2 := Random(RangeMax-RangeMin)+RangeMin;
Op3 := constants[Random(5) + 1];
if (Op1 = 0) or (Op2 = 0) then GleicherExponent;
if NegFlag = False then
begin
Op1 := Abs(Op1);
Op2 := Abs(Op2);
end;
if Op = 1 then
begin
Form1.LblOp.Caption := '*';
Sol := Op1 * Op2;
end
else
begin
Form1.LblOp.Caption := ':';
if RoundFlag = True then
begin
Sol := SolRound((Op1 / Op2), 2)
end
else
begin
SolBas := Round(Op1 / Op2);
Op1 := SolBas * Op2;
Form1.LblExOp1Bas.Caption := inttostr(Op1);
Sol := Op1 / Op2;
end;
end;
if (Op1 = 0) or (Op2 = 0) then GleicherExponent;
Form1.LblExOp2Bas.Caption := inttostr(Op2);
Form1.LblExOp1Bas.Caption := inttostr(Op1);
Form1.LblExOp1Exp.Caption := Op3;
Form1.LblExOp2Exp.Caption := Form1.LblExOp1Exp.Caption;
Form1.StatusBarInstruction.Panels[0].Text := 'Rechnen Sie bitte die Basis aus!';
Form1.LblExOp1Bas.Visible := True;
Form1.LblExOp1Exp.Visible := True;
Form1.LblBrackets.Visible := False;
Form1.LblExOp2Bas.Visible := True;
Form1.LblExOp2Exp.Visible := True;
Form1.BtnSubmit.Visible := True;
Form1.TxtSolBas.Visible := True;
Form1.TxtSolExp.Visible := True;
Form1.LblEqual.Visible := True;
Form1.LblOp.Visible := True;
Form1.TxtSolBas.SetFocus;
Form1.BtnNextEx.Visible := True;
Form1.BtnSubmit.Enabled := True;
Form1.BtnCalc.Visible := True;
Form1.BtnNextEx.Enabled := False;
Form1.TxtSolBas.SetFocus;
UpdateCounter;
end;
procedure GleicheBasis;
begin
ResetDisplay;
Op := Random(2);
Op1 := Random(RangeMax - RangeMin) + RangeMin;
Op2 := Random(RangeMax - RangeMin) + RangeMin;
Op3 := Constants[Random(5) + 1];
if (Op1 = 0) or (Op2 = 0) then GleicheBasis;
if NegFlag = False then
begin
Op1 := Abs(Op1);
Op2 := Abs(Op2);
end;
if Op = 1 then
begin
Form1.LblOp.Caption := '*';
Sol := Op1 + Op2;
end
else
begin
if Op1 = Op2 then GleicheBasis;
Form1.LblOp.Caption := ':';
Sol := Op1 - Op2;
end;
Form1.LblExOp1Exp.Caption := inttostr(Op1);
Form1.LblExOp2Exp.Caption := inttostr(Op2);
Form1.LblExOp1Bas.Caption := Op3;
Form1.LblExOp2Bas.Caption := Form1.LblExOp1Bas.Caption;
Form1.StatusBarInstruction.Panels[0].Text := 'Rechnen Sie bitte den Exponenten aus!';
Form1.LblExOp1Bas.Visible := True;
Form1.LblExOp1Exp.Visible := True;
Form1.LblExOp2Bas.Visible := True;
Form1.LblExOp2Exp.Visible := True;
Form1.BtnSubmit.Visible := True;
Form1.TxtSolBas.Visible := True;
Form1.TxtSolExp.Visible := True;
Form1.LblEqual.Visible := True;
Form1.LblOp.Visible := True;
Form1.TxtSolExp.SetFocus;
Form1.BtnNextEx.Visible := True;
Form1.BtnSubmit.Enabled := True;
Form1.BtnNextEx.Enabled := False;
Form1.BtnCalc.Visible := True;
Form1.TxtSolBas.SetFocus;
UpdateCounter;
end;
procedure PotenzeinerPotenz;
begin
ResetDisplay;
Op1 := Random(RangeMax-RangeMin)+RangeMin;
Op2 := Random(RangeMax-RangeMin)+RangeMin;
Op3 := constants[Random(5) + 1];
if (Op1 = 0) or (Op2 = 0) then PotenzeinerPotenz;
if NegFlag = False then
begin
Op1 := Abs(Op1);
Op2 := Abs(Op2);
end;
Form1.LblExOp1Exp.Caption := inttostr(Op1);
Form1.LblExOp1ExpExp.Caption := inttostr(Op2);
Sol := Op1 * Op2;
Form1.LblExOp1Bas.Caption := Op3;
Form1.StatusBarInstruction.Panels[0].Text := 'Rechnen Sie bitte den Exponenten aus!';
Form1.LblExOp1Bas.Visible := True;
Form1.LblExOp1Exp.Visible := True;
Form1.LblExOp1ExpExp.Visible := True;
Form1.LblBrackets.Visible := True;
Form1.LblOp.Visible := False;
Form1.BtnSubmit.Visible := True;
Form1.TxtSolBas.Visible := True;
Form1.TxtSolExp.Visible := True;
Form1.LblEqual.Visible := True;
Form1.TxtSolExp.SetFocus;
Form1.BtnNextEx.Visible := True;
Form1.BtnSubmit.Enabled := True;
Form1.BtnNextEx.Enabled := False;
Form1.BtnCalc.Visible := True;
Form1.TxtSolBas.SetFocus;
UpdateCounter;
end;
procedure ExRandom;
begin
ExType := Random(3) + 1;
case ExType of
1: GleicherExponent;
2: GleicheBasis;
3: PotenzeinerPotenz;
end;
end;
procedure TForm1.MnuGleicherExponentClick(Sender: TObject);
begin
Reset;
ExType := 1;
GleicherExponent;
StartTime := GetTickCount;
end;
procedure TForm1.MnuGleicheBasisClick(Sender: TObject);
begin
Reset;
ExType := 2;
GleicheBasis;
StartTime := GetTickCount;
end;
procedure TForm1.MnuPotenzeinerPotenzClick(Sender: TObject);
begin
Reset;
ExType := 3;
PotenzeinerPotenz;
StartTime := GetTickCount;
end;
procedure TForm1.Zufaellig1Click(Sender: TObject);
begin
Reset;
RanFlag := True;
ExRandom;
StartTime := GetTickCount;
end;
procedure TForm1.BtnSubmitClick(Sender: TObject);
begin
try
case ExType of
0: // Keine Übung ausgewählt
StatusBarInstruction.Panels[0].Text := 'Wählen Sie bitte eine Übung aus!';
1: // Gleicher Exponent
if (Sol = SolRound(strtofloat(TxtSolBas.Text), 2)) and (LblExOp1Exp.Caption = TxtSolExp.Text) then
Flag := True
else
begin
Flag := False;
if (Sol = SolRound(strtofloat(TxtSolBas.Text), 2)) and (LblExOp1Exp.Caption <> TxtSolExp.Text) then
TxtSolExp.Font.Color := clRed
else if (Sol <> SolRound(strtofloat(TxtSolBas.Text), 2)) and (LblExOp1Exp.Caption = TxtSolExp.Text) then
TxtSolBas.Font.Color := clRed
else
begin
TxtSolBas.Font.Color := clRed;
TxtSolExp.Font.Color := clRed;
end;
StatusBarInstruction.Panels[0].Text := 'Falsch! ' + FloattoStr(Sol) + ' hoch ' + Op3 + ' wäre richtig gewesen!';
end;
2: // Gleiche Basis
if (Sol = strtofloat(TxtSolExp.Text)) and (Op3 = TxtSolBas.Text) then
Flag := True
else
begin
Flag := False;
if (Sol = SolRound(strtofloat(TxtSolExp.Text), 2)) and (LblExOp1Bas.Caption <> TxtSolBas.Text) then
TxtSolBas.Font.Color := clRed
else if (Sol <> SolRound(strtofloat(TxtSolExp.Text), 2)) and (LblExOp1Bas.Caption = TxtSolBas.Text) then
TxtSolExp.Font.Color := clRed
else
begin
TxtSolBas.Font.Color := clRed;
TxtSolExp.Font.Color := clRed;
end;
StatusBarInstruction.Panels[0].Text := 'Falsch! ' + Op3 + ' hoch ' + floattostr(Sol) + ' wäre richtig gewesen!';
end;
3: // Potenz einer Potenz
if (Sol = strtofloat(TxtSolExp.Text)) and (Op3 = TxtSolBas.Text) then
Flag := True
else
begin
Flag := False;
if (Sol = SolRound(strtofloat(TxtSolExp.Text), 2)) and (LblExOp1Bas.Caption <> TxtSolBas.Text) then
TxtSolBas.Font.Color := clRed
else if (Sol <> SolRound(strtofloat(TxtSolExp.Text), 2)) and (LblExOp1Bas.Caption = TxtSolBas.Text) then
TxtSolExp.Font.Color := clRed
else
begin
TxtSolBas.Font.Color := clRed;
TxtSolExp.Font.Color := clRed;
end;
StatusBarInstruction.Panels[0].Text := 'Falsch! ' + Op3 + ' hoch ' + floattostr(Sol) + ' wäre richtig gewesen!';
end;
end;
if Flag = True then
begin
StatusBarInstruction.Panels[0].Text := 'Richtig!';
BtnNextEx.Enabled := True;
BtnSubmit.Visible := True;
BtnSubmit.Enabled := False;
BtnNextEx.SetFocus;
inc(ExRight);
if RanFlag = True then ExType := 4;
if SoundFlag = True then sndPlaySound(SoundRight, SND_ASYNC);
end
else
begin
BtnNextEx.Enabled := True;
BtnSubmit.Visible := True;
BtnSubmit.Enabled := False;
BtnNextEx.SetFocus;
Flag := True;
inc(ExWrong);
if SoundFlag = True then sndPlaySound(SoundWrong, SND_ASYNC);
end;
inc(Ex);
TxtSolBas.ReadOnly := True;
TxtSolExp.ReadOnly := True;
except
on EConvertError do
StatusBarInstruction.Panels[0].Text := 'Das ist keine Zahl!';
end;
end;
procedure TForm1.BtnNextExClick(Sender: TObject);
begin
if Ex < ExMax then
begin
if RanFlag = True then
ExRandom
else
begin
case ExType of
0: StatusBarInstruction.Panels[0].Text := 'Wählen Sie bitte eine Übung aus!';
1: GleicherExponent;
2: GleicheBasis;
3: PotenzeinerPotenz;
end;
end;
end
else
begin
UpdateCounter;
TimeFlag := False;
TimerTimer(Sender);
Form2.ShowModal;
TimeFlag := True;
Reset;
end;
end;
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
case Key of
#13:
if ExType <> 0 then
if Flag = True then
begin
Key := #0;
Form1.BtnNextExClick(Sender)
end
else
begin
Key := #0;
Form1.BtnSubmitClick(Sender);
end;
end;
end;
procedure TForm1.NegativeExponenten1Click(Sender: TObject);
begin
if NegFlag = True then
begin
NegativeExponenten1.Checked := False;
NegFlag := False;
end
else
begin
NegativeExponenten1.Checked := True;
NegFlag := True;
end;
end;
procedure TForm1.Aufgaben1Click(Sender: TObject);
begin
try
ExMax := strtoint(InputBox ('Anzahl der Aufgaben', 'Wie viele Aufgaben wollen Sie gestellt bekommen?', inttostr(ExMax)));
except
Application.MessageBox ('Das ist keine Zahl!', 'Fehler', 0+16);
end;
if ExType <> 0 then UpdateCounter;
end;
procedure TForm1.Zahlenbereich1Click(Sender: TObject);
begin
try
RangeMin := strtoint(InputBox ('Zahlenbereich', 'Wie groß soll die kleinste Zahl sein?', inttostr(RangeMin)));
RangeMax := strtoint(InputBox ('Zahlenbereich', 'Wie groß soll die größte Zahl sein?', inttostr(RangeMax)));
except
Application.MessageBox ('Das ist keine Zahl!', 'Fehler', 0+16);
end;
end;
procedure TForm1.MnuBeendenClick(Sender: TObject);
begin
Close;
end;
procedure TForm1.MnuAuswertenClick(Sender: TObject);
begin
if (ExType <> 0) and (Ex >= 1) then
begin
Timer.Enabled := False;
Form2.ShowModal;
Timer.Enabled := True;
Reset;
end
else
Application.MessageBox ('Bitte rechnen Sie zuerst eine Aufgabe!', 'Fehler', 0+48);
end;
procedure TForm1.InternetRanking1Click(Sender: TObject);
begin
ShellExecute(Form2.Handle,'open',PChar(MainUrl),nil,nil,SW_SHOWNORMAL);
end;
procedure TForm1.Round1Click(Sender: TObject);
begin
if RoundFlag = True then
begin
RoundFlag := False;
Round1.Checked := False;
end
else
begin
RoundFlag := True;
Round1.Checked := True;
end;
end;
procedure TForm1.TimerTimer(Sender: TObject);
begin
if (TimeFlag = True) and (ExType <> 0) then
begin
TotalTime := GetTickCount - StartTime;
StatusBarInstruction.Panels[1].Text := FloattoStrF(TotalTime / 1000, ffFixed, 7, 2) + ' sec';
end
else
StatusBarInstruction.Panels[1].Text := '';
end;
procedure TForm1.Hilfe1Click(Sender: TObject);
begin
Application.HelpCommand(HELP_FINDER, 0);
end;
procedure TForm1.Ueber1Click(Sender: TObject);
begin
Form3.ShowModal;
end;
procedure TForm1.Sounds1Click(Sender: TObject);
begin
if SoundFlag = True then
begin
SoundFlag := False;
Sounds1.Checked := False;
end
else
begin
SoundFlag := True;
Sounds1.Checked := True;
end;
end;
procedure TForm1.Zeitanzeigen1Click(Sender: TObject);
begin
if TimeFlag = True then
begin
TimeFlag := False;
Zeitanzeigen1.Checked := False;
end
else
begin
TimeFlag := True;
Zeitanzeigen1.Checked := True;
end;
end;
procedure TForm1.BtnCalcClick(Sender: TObject);
begin
ShellExecute(Handle, 'open', 'calc.exe', '', nil, SW_SHOW);
end;
end.

BIN
Unit2.dcu Executable file

Binary file not shown.

BIN
Unit2.dfm Executable file

Binary file not shown.

79
Unit2.pas Executable file
View file

@ -0,0 +1,79 @@
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, ShellApi, MMSystem;
type
TForm2 = class(TForm)
Label1: TLabel;
Label2: TLabel;
ProgressBar: TProgressBar;
BtnClose: TButton;
Transfer: TButton;
procedure FormShow(Sender: TObject);
procedure BtnCloseClick(Sender: TObject);
procedure TransferClick(Sender: TObject);
private
{ Private-Deklarationen}
public
{ Public-Deklarationen}
end;
var
Form2: TForm2;
Url: String;
Value: Real;
implementation
uses Unit1;
{$R *.DFM}
procedure TForm2.FormShow(Sender: TObject);
begin
TotalTime := GetTickCount - StartTime;
Value := Round(((ExRight / (TotalTime / Ex)) - (ExWrong / (TotalTime / Ex))) * 1000000);
if RanFlag = True then Value := Value * 1.5;
if RoundFlag = True then Value := Value * 2;
if NegFlag = True then Value := Value * 1.2;
if Value < 0 then Value := 0;
Label2.Caption := 'Sie haben ' + inttostr(ExRight) + ' von ' + inttostr(Ex) + ' Aufgaben richtig gelöst.' + Chr(13) + 'Das sind ' + inttostr(Round((ExRight/Ex)*100)) + '%.' + Chr(13) + 'Dafür haben Sie ' + FloattoStrF(TotalTime / 1000, ffFixed, 7, 2) + ' Sekunden gebraucht.' + Chr(13) + 'Insgesamt haben Sie ' + floattostr(Value) + ' Punkte.';
Progressbar.Max := ExMax;
Progressbar.Position := ExRight;
if Round((ExRight / Ex) * 100) > 50 then
if SoundFlag = True then sndPlaySound(SoundGoodResult, SND_LOOP)
else
if SoundFlag = True then sndPlaySound(SoundBadResult, SND_LOOP);
end;
procedure TForm2.BtnCloseClick(Sender: TObject);
begin
sndPlaySound(nil,0);
Form2.Close;
end;
procedure TForm2.TransferClick(Sender: TObject);
begin
if Value > 0 then
if InputQuery('Name', 'Wie heißen sie?', TransName) and InputQuery('Kommentar', 'Haben sie noch etwas zu sagen?!', TransComment) then
if TransName = '' then
Application.MessageBox ('Bitte geben Sie ihren Namen an!', 'Fehler', 0+16)
else
begin
Url := MainUrl + '?name=' + TransName + '&value=' + FloattoStr(Value) + '&comment=' + TransComment;
ShellExecute(Form2.Handle,'open',PChar(Url),nil,nil,SW_SHOWNORMAL);
end
else
Application.MessageBox ('Ihre Angaben sind nicht vollständig!', 'Fehler', 0+16)
else
Application.MessageBox ('Sie brauchen mindestens einen Punkt!', 'Nicht genügend Punkte', 0+16);
end;
end.

BIN
Unit3.dcu Executable file

Binary file not shown.

BIN
Unit3.dfm Executable file

Binary file not shown.

44
Unit3.pas Executable file
View file

@ -0,0 +1,44 @@
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ComCtrls, ShellApi;
type
TForm3 = class(TForm)
Image1: TImage;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
RichEdit1: TRichEdit;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen}
public
{ Public-Deklarationen}
end;
var
Form3: TForm3;
implementation
uses Unit2;
{$R *.DFM}
procedure TForm3.Button2Click(Sender: TObject);
begin
ShellExecute(Form2.Handle,'open','http://www.fsf.org/licensing/licenses/gpl.html',nil,nil,SW_SHOWNORMAL);
end;
procedure TForm3.Button1Click(Sender: TObject);
begin
Close
end;
end.

BIN
Wrong.wav Executable file

Binary file not shown.