Turtle - падение инсталлятора

This commit is contained in:
Mikhalkovich Stanislav 2020-07-07 21:52:34 +03:00
parent 3d58e80406
commit ca363a002d
10 changed files with 114 additions and 7 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "6";
public const string Build = "3";
public const string Revision = "2552";
public const string Revision = "2556";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=3
%REVISION%=2552
%REVISION%=2556
%MINOR%=6
%MAJOR%=3

View file

@ -0,0 +1,53 @@
uses Turtle,GraphWPF;
var
Atom,FStr,XStr,YStr: string;
angle,len,x0,y0: real;
n: integer;
procedure Init1; // Dragon
begin
(Atom,FStr,XStr,YStr) := ('fx','f','x+yf+','-fx-y');
(angle,len,n,x0,y0) := (90,3,15,300,450);
end;
procedure Init2; // Koch curve
begin
(Atom,FStr,XStr,YStr) := ('F', 'F-F++F-F', '', '');
(angle,len,n,x0,y0) := (60,5,7,10,550);
end;
procedure Init3; // Quadratic Koch Island
begin
(Atom,FStr,XStr,YStr) := ('F+F+F+F', 'F+F-FF+F+F-F', '', '');
(angle,len,n,x0,y0) := (90,4,4,250,450);
end;
procedure Init4; // Gosper hexagonal curve
begin
(Atom,FStr,XStr,YStr) := ('XF', 'F', 'X+YF++YF-FX--FXFX-YF+','-FX+YFYF++YF+FX--FX-Y');
(angle,len,n,x0,y0) := (60,4,5,580,56);
end;
procedure RunStr(s: string; n: integer);
begin
foreach var c in s do
case c of
'+': Turn(angle);
'-': Turn(-angle);
'f','F': if n>0 then RunStr(FStr,n-1) else Forw(len);
'x','X': if n>0 then RunStr(XStr,n-1);
'y','Y': if n>0 then RunStr(YStr,n-1);
else Print('error')
end;
end;
begin
Init4;
ToPoint(x0,y0);
SetWidth(0.5);
//SetColor(Colors.Red);
Down;
RunStr(Atom,n);
Up;
end.

Binary file not shown.

View file

@ -1 +1 @@
3.6.3.2552
3.6.3.2556

View file

@ -1 +1 @@
!define VERSION '3.6.3.2552'
!define VERSION '3.6.3.2556'

View file

@ -6,7 +6,7 @@
GraphABCHelper,
GraphWPFBase,
Graph3D,
GraphWPF,
GraphWPF, Turtle,
WPFObjects,
NumLibABC,
IniFile, PointerTools, PointRect, PT4, PT4MakerNetX, Robot, RobotField,

View file

@ -134,6 +134,7 @@
File ..\bin\Lib\OpenGLABC.pcu
File ..\bin\Lib\School.pcu
File ..\bin\Lib\SF.pcu
File ..\bin\Lib\Turtle.pcu
File ..\bin\Lib\PABCRtl.dll
File ..\bin\Lib\HelixToolkit.Wpf.dll
@ -202,6 +203,7 @@
${AddFile} "OpenGLABC.pcu"
${AddFile} "School.pcu"
${AddFile} "SF.pcu"
${AddFile} "Turtle.pcu"
${AddFile} "PABCRtl.dll"
${AddFile} "HelixToolkit.Wpf.dll"
@ -281,6 +283,7 @@
File ..\bin\Lib\OpenGLABC.pas
File ..\bin\Lib\School.pas
File ..\bin\Lib\SF.pas
File ..\bin\Lib\Turtle.pas
File ..\bin\Lib\__RedirectIOMode.vb
File ..\bin\Lib\VBSystem.vb
@ -346,6 +349,7 @@
${AddFile} "OpenGLABC.pas"
${AddFile} "School.pas"
${AddFile} "SF.pas"
${AddFile} "Turtle.pas"
${AddFile} "__RedirectIOMode.vb"
${AddFile} "VBSystem.vb"

View file

@ -108,7 +108,7 @@ type
begin
var tb := new GTextBlock;
element := tb;
element.Margin := new Thickness(0, 0, 0, GlobalHMargin);
//element.Margin := new Thickness(0, 0, 0, GlobalHMargin);
//element.Margin := new Thickness(5,5,5,0);
tb.FontSize := fontsize;
Text := Txt;
@ -346,12 +346,13 @@ protected
sl.Minimum := min;
sl.Maximum := max;
sl.Value := val;
sl.Foreground := Brushes.Black;
ActivePanel.Children.Add(sl);
end;
procedure ValueChangedP := if ValueChanged <> nil then ValueChanged;
public
event ValueChanged: procedure;
ValueChanged: procedure;
constructor Create(min, max, val: real);
begin
Invoke(CreateP, min, max, val);

49
bin/Lib/Turtle.pas Normal file
View file

@ -0,0 +1,49 @@
/// Исполнитель Черепаха
unit Turtle;
uses GraphWPF;
var
tp := Window.Center;
a: real := 0;
dr := False;
/// Поворачивает Черепаху на угол da против часовой стрелки
procedure Turn(da: real);
begin
a += da;
end;
/// Продвигает Черепаху вперёд на расстояние r
procedure Forw(r: real);
begin
tp += r * Vect(Cos(DegToRad(a)),Sin(DegToRad(a)));
if dr then
LineTo(tp.X,tp.Y)
else MoveTo(tp.X,tp.Y)
end;
/// Опускает хвост Черепахи
procedure Down := dr := True;
/// Поднимает хвост Черепахи
procedure Up := dr := False;
/// Устанавливает ширину линии
procedure SetWidth(w: real) := Pen.Width := w;
/// Устанавливает цвет линии
procedure SetColor(c: GColor) := Pen.Color := c;
/// Перемещает Черепаху в точку (x,y)
procedure ToPoint(x,y: real);
begin
tp := Pnt(x,y);
MoveTo(tp.X,tp.Y);
end;
begin
pen.RoundCap := True;
MoveTo(tp.X,tp.Y)
end.