Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
cricri-pingouin committed May 9, 2020
1 parent f40af86 commit 66c9352
Show file tree
Hide file tree
Showing 31 changed files with 2,200 additions and 0 deletions.
Binary file added HIGHSCORES.dcu
Binary file not shown.
Binary file added HIGHSCORES.ddp
Binary file not shown.
39 changes: 39 additions & 0 deletions HIGHSCORES.dfm
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
41 changes: 41 additions & 0 deletions HIGHSCORES.pas
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 added NoBoard.bmp
Binary file not shown.
Binary file added OPTIONS.dcu
Binary file not shown.
Binary file added OPTIONS.ddp
Binary file not shown.
Binary file added OPTIONS.dfm
Binary file not shown.
124 changes: 124 additions & 0 deletions OPTIONS.pas
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 added SliMind.ico
Binary file not shown.
Binary file added blue.bmp
Binary file not shown.
Binary file added brown.bmp
Binary file not shown.
Binary file added green.bmp
Binary file not shown.
Binary file added markerBlack.bmp
Binary file not shown.
Binary file added markerblank.bmp
Binary file not shown.
Binary file added markerwhite.bmp
Binary file not shown.
Binary file added mmind.dcu
Binary file not shown.
Loading

0 comments on commit 66c9352

Please sign in to comment.