-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f40af86
commit 66c9352
Showing
31 changed files
with
2,200 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
object frmScores: TfrmScores | ||
Left = 445 | ||
Top = 479 | ||
BorderStyle = bsDialog | ||
Caption = 'High Scores' | ||
ClientHeight = 277 | ||
ClientWidth = 405 | ||
Color = clBtnFace | ||
Font.Charset = DEFAULT_CHARSET | ||
Font.Color = clWindowText | ||
Font.Height = -13 | ||
Font.Name = 'MS Sans Serif' | ||
Font.Style = [] | ||
OldCreateOrder = False | ||
Scaled = False | ||
OnShow = FormShow | ||
PixelsPerInch = 120 | ||
TextHeight = 16 | ||
object strngrdHS: TStringGrid | ||
Left = 0 | ||
Top = 0 | ||
Width = 405 | ||
Height = 277 | ||
ColCount = 3 | ||
RowCount = 11 | ||
Font.Charset = DEFAULT_CHARSET | ||
Font.Color = clNavy | ||
Font.Height = -18 | ||
Font.Name = 'MS Sans Serif' | ||
Font.Style = [] | ||
ParentFont = False | ||
ScrollBars = ssNone | ||
TabOrder = 0 | ||
ColWidths = ( | ||
34 | ||
266 | ||
98) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
unit HIGHSCORES; | ||
|
||
interface | ||
|
||
uses | ||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | ||
Dialogs, Grids, mmind; | ||
|
||
type | ||
TfrmScores = class(TForm) | ||
strngrdHS: TStringGrid; | ||
procedure FormShow(Sender: TObject); | ||
private | ||
{ Private declarations } | ||
public | ||
{ Public declarations } | ||
end; | ||
|
||
var | ||
frmScores: TfrmScores; | ||
|
||
implementation | ||
|
||
{$R *.dfm} | ||
|
||
procedure TfrmScores.FormShow(Sender: TObject); | ||
var | ||
I: Integer; | ||
begin | ||
strngrdHS.Cells[1, 0] := 'Name'; | ||
strngrdHS.Cells[2, 0] := 'Guesses'; | ||
for I := 1 to 10 do | ||
begin | ||
strngrdHS.Cells[0, I] := IntToStr(I); | ||
strngrdHS.Cells[1, I] := frmMind.HSname[I]; | ||
strngrdHS.Cells[2, I] := IntToStr(frmMind.HSguesses[I]); | ||
end; | ||
end; | ||
|
||
end. | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
unit OPTIONS; | ||
|
||
interface | ||
|
||
uses | ||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | ||
Dialogs, StdCtrls, ExtCtrls, mmind, IniFiles; | ||
|
||
type | ||
tfrmOptions = class(TForm) | ||
btnKids: TButton; | ||
btnMastermind: TButton; | ||
btnDeluxe: TButton; | ||
lblPegs: TLabel; | ||
scrlPegs: TScrollBar; | ||
lblPegsVal: TLabel; | ||
lblColours: TLabel; | ||
scrlColours: TScrollBar; | ||
lblColoursVal: TLabel; | ||
lblAttempts: TLabel; | ||
scrlAttempts: TScrollBar; | ||
lblAttemptsVal: TLabel; | ||
chkRepeatColours: TCheckBox; | ||
btnCancel: TButton; | ||
btnOk: TButton; | ||
procedure btnCancelClick(Sender: TObject); | ||
procedure btnOkClick(Sender: TObject); | ||
procedure FormCreate(Sender: TObject); | ||
procedure scrlPegsChange(Sender: TObject); | ||
procedure scrlColoursChange(Sender: TObject); | ||
procedure scrlAttemptsChange(Sender: TObject); | ||
procedure btnKidsClick(Sender: TObject); | ||
procedure btnMastermindClick(Sender: TObject); | ||
procedure btnDeluxeClick(Sender: TObject); | ||
private | ||
{ Private declarations } | ||
public | ||
{ Public declarations } | ||
end; | ||
|
||
var | ||
frmOptions: tfrmOptions; | ||
|
||
implementation | ||
|
||
{$R *.dfm} | ||
|
||
procedure tfrmOptions.btnKidsClick(Sender: TObject); | ||
begin | ||
scrlPegs.Position := 3; | ||
scrlColours.Position := 6; | ||
scrlAttempts.Position := 9; | ||
end; | ||
|
||
procedure tfrmOptions.btnMastermindClick(Sender: TObject); | ||
begin | ||
scrlPegs.Position := 4; | ||
scrlColours.Position := 6; | ||
scrlAttempts.Position := 10; | ||
end; | ||
|
||
procedure tfrmOptions.btnDeluxeClick(Sender: TObject); | ||
begin | ||
scrlPegs.Position := 5; | ||
scrlColours.Position := 8; | ||
scrlAttempts.Position := 12; | ||
end; | ||
|
||
procedure tfrmOptions.btnCancelClick(Sender: TObject); | ||
begin | ||
Close; | ||
end; | ||
|
||
procedure tfrmOptions.btnOkClick(Sender: TObject); | ||
var | ||
myINI: TINIFile; | ||
begin | ||
if (chkRepeatColours.Checked = False) and (scrlPegs.Position > scrlColours.Position) then | ||
begin | ||
showmessage('You cannot have more pegs than colours if you don''t allow repeat colours!' + sLineBreak + 'Please change your settings to eliminate this conflict.'); | ||
Exit; | ||
end; | ||
frmMind.NumPegs := scrlPegs.Position; | ||
frmMind.NumColours := scrlColours.Position; | ||
frmMind.NumAllowedAttempts := scrlAttempts.Position; | ||
frmMind.RepeatColours := chkRepeatColours.Checked; | ||
//Save settings to INI file | ||
myINI := TINIFile.Create(ExtractFilePath(Application.EXEName) + 'SliMind.ini'); | ||
myINI.WriteInteger('Settings', 'Pegs', frmMind.NumPegs); | ||
myINI.WriteInteger('Settings', 'Colours', frmMind.NumColours); | ||
myINI.WriteInteger('Settings', 'AllowedAttempts', frmMind.NumAllowedAttempts); | ||
myINI.WriteBool('Settings', 'AllowRepeatColours', frmMind.RepeatColours); | ||
myINI.Free; | ||
Close; | ||
end; | ||
|
||
procedure tfrmOptions.FormCreate(Sender: TObject); | ||
begin | ||
scrlPegs.Position := frmMind.NumPegs; | ||
lblPegsVal.Caption := IntToStr(scrlPegs.Position); | ||
scrlColours.Position := frmMind.NumColours; | ||
lblColoursVal.Caption := IntToStr(scrlColours.Position); | ||
scrlAttempts.Position := frmMind.NumAllowedAttempts; | ||
lblAttemptsVal.Caption := IntToStr(scrlAttempts.Position); | ||
chkRepeatColours.Checked := frmMind.RepeatColours; | ||
end; | ||
|
||
procedure tfrmOptions.scrlPegsChange(Sender: TObject); | ||
begin | ||
lblPegsVal.Caption := IntToStr(scrlPegs.Position); | ||
end; | ||
|
||
procedure tfrmOptions.scrlColoursChange(Sender: TObject); | ||
begin | ||
lblColoursVal.Caption := IntToStr(scrlColours.Position); | ||
end; | ||
|
||
procedure tfrmOptions.scrlAttemptsChange(Sender: TObject); | ||
begin | ||
lblAttemptsVal.Caption := IntToStr(scrlAttempts.Position); | ||
end; | ||
|
||
end. | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.