diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 2d43b1497..2e0e7111b 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "8"; public const string Build = "2"; - public const string Revision = "3039"; + public const string Revision = "3041"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 8efa0fcbe..db3d7bb87 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=8 -%REVISION%=3039 +%REVISION%=3041 %COREVERSION%=2 %MAJOR%=3 diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for array [,] of T.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for array [,] of T.html index 5d94fff61..339659010 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for array [,] of T.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for array [,] of T.html @@ -65,7 +65,7 @@ function Indices<T>(Self: array [,] of T; cond: (T,integer,integer) -> boolean): sequence of (integer, integer);
        Возвращает по заданному двумерному массиву последовательность индексов элементов, удовлетворяющих заданному условию function MatrEqual<T>(Self,b: array[,] of T): boolean; -
        Есть ли элемент в матрице +
        Равны ли матрицы function MatrSlice<T>(Self: array[,] of T; RowIndex: array of integer; ColIndex: array of integer): array[,] of T;
        Возвращает срез двумерного массива. RowIndex и ColIndex задают срезаемые строки и столбцы function MatrSlice<T>(Self: array[,] of T; FromRow, ToRow, FromCol, ToCol: integer): array[,] of T; diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Math subroutines.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Math subroutines.html index e86b5cd50..b013ae70a 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Math subroutines.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Math subroutines.html @@ -98,6 +98,14 @@
        Возвращает случайное целое в диапазоне от a до b function Random(a, b: real): real;
        Возвращает случайное вещественное в диапазоне [a,b) +function Random(a, b: char): char; +
        Возвращает случайный символ в диапазоне от a до b +function Random(diap: IntRange): integer; +
        Возвращает случайное целое в диапазоне +function Random(diap: RealRange): real; +
        Возвращает случайное вещественное в диапазоне +function Random(diap: CharRange): char; +
        Возвращает случайный символ в диапазоне function Random: real;
        Возвращает случайное вещественное в диапазоне [0..1) function Random2(maxValue: integer): (integer, integer); @@ -106,8 +114,16 @@
        Возвращает кортеж из двух случайных вещественных в диапазоне [0,maxValue) function Random2(a, b: integer): (integer, integer);
        Возвращает кортеж из двух случайных целых в диапазоне от a до b +function Random2(a, b: char): (char, char); +
        Возвращает кортеж из двух случайных символов в диапазоне от a до b function Random2(a, b: real): (real, real);
        Возвращает кортеж из двух случайных вещественных в диапазоне [a,b) +function Random2(diap: IntRange): (integer, integer); +
        Возвращает кортеж из двух случайных целых в диапазоне +function Random2(diap: CharRange): (char, char); +
        Возвращает кортеж из двух случайных символов в диапазоне +function Random2(diap: RealRange): (real, real); +
        Возвращает кортеж из двух случайных вещественных в диапазоне function Random2: (real, real);
        Возвращает кортеж из двух случайных вещественных в диапазоне [0..1) function Random3(maxValue: integer): (integer, integer, integer); @@ -116,8 +132,16 @@
        Возвращает кортеж из трех случайных вещественных в диапазоне [0,maxValue) function Random3(a, b: integer): (integer, integer, integer);
        Возвращает кортеж из трех случайных целых в диапазоне от a до b +function Random3(a, b: char): (char, char, char); +
        Возвращает кортеж из трех случайных символов в диапазоне от a до b function Random3(a, b: real): (real, real, real);
        Возвращает кортеж из трех случайных вещественных в диапазоне [a,b) +function Random3(diap: IntRange): (integer, integer, integer); +
        Возвращает кортеж из трех случайных целых в диапазоне +function Random3(diap: CharRange): (char, char, char); +
        Возвращает кортеж из трех случайных символов в диапазоне +function Random3(diap: RealRange): (real, real, real); +
        Возвращает кортеж из трех случайных вещественных в диапазоне function Random3: (real, real, real);
        Возвращает кортеж из трех случайных вещественных в диапазоне [0..1) procedure Randomize(seed: integer); diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 5eaa27fea..faeb86737 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.2.3039 +3.8.2.3041 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index bb44b8d8a..f9bc4d6e1 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.2.3039' +!define VERSION '3.8.2.3041' diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index ec1032850..9141a565c 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -1687,6 +1687,14 @@ function Random(maxValue: real): real; function Random(a, b: integer): integer; /// Возвращает случайное вещественное РІ диапазоне [a,b) function Random(a, b: real): real; +/// Возвращает случайный СЃРёРјРІРѕР» РІ диапазоне РѕС‚ a РґРѕ b +function Random(a, b: char): char; +/// Возвращает случайное целое РІ диапазоне +function Random(diap: IntRange): integer; +/// Возвращает случайное вещественное РІ диапазоне +function Random(diap: RealRange): real; +/// Возвращает случайный СЃРёРјРІРѕР» РІ диапазоне +function Random(diap: CharRange): char; /// Возвращает случайное вещественное РІ диапазоне [0..1) function Random: real; /// Возвращает кортеж РёР· РґРІСѓС… случайных целых РІ диапазоне РѕС‚ 0 РґРѕ maxValue-1 @@ -1695,8 +1703,16 @@ function Random2(maxValue: integer): (integer, integer); function Random2(maxValue: real): (real, real); /// Возвращает кортеж РёР· РґРІСѓС… случайных целых РІ диапазоне РѕС‚ a РґРѕ b function Random2(a, b: integer): (integer, integer); +/// Возвращает кортеж РёР· РґРІСѓС… случайных символов РІ диапазоне РѕС‚ a РґРѕ b +function Random2(a, b: char): (char, char); /// Возвращает кортеж РёР· РґРІСѓС… случайных вещественных РІ диапазоне [a,b) function Random2(a, b: real): (real, real); +/// Возвращает кортеж РёР· РґРІСѓС… случайных целых РІ диапазоне +function Random2(diap: IntRange): (integer, integer); +/// Возвращает кортеж РёР· РґРІСѓС… случайных символов РІ диапазоне +function Random2(diap: CharRange): (char, char); +/// Возвращает кортеж РёР· РґРІСѓС… случайных вещественных РІ диапазоне +function Random2(diap: RealRange): (real, real); /// Возвращает кортеж РёР· РґРІСѓС… случайных вещественных РІ диапазоне [0..1) function Random2: (real, real); /// Возвращает кортеж РёР· трех случайных целых РІ диапазоне РѕС‚ 0 РґРѕ maxValue-1 @@ -1705,8 +1721,16 @@ function Random3(maxValue: integer): (integer, integer, integer); function Random3(maxValue: real): (real, real, real); /// Возвращает кортеж РёР· трех случайных целых РІ диапазоне РѕС‚ a РґРѕ b function Random3(a, b: integer): (integer, integer, integer); +/// Возвращает кортеж РёР· трех случайных символов РІ диапазоне РѕС‚ a РґРѕ b +function Random3(a, b: char): (char, char, char); /// Возвращает кортеж РёР· трех случайных вещественных РІ диапазоне [a,b) function Random3(a, b: real): (real, real, real); +/// Возвращает кортеж РёР· трех случайных целых РІ диапазоне +function Random3(diap: IntRange): (integer, integer, integer); +/// Возвращает кортеж РёР· трех случайных символов РІ диапазоне +function Random3(diap: CharRange): (char, char, char); +/// Возвращает кортеж РёР· трех случайных вещественных РІ диапазоне +function Random3(diap: RealRange): (real, real, real); /// Возвращает кортеж РёР· трех случайных вещественных РІ диапазоне [0..1) function Random3: (real, real, real); @@ -8377,12 +8401,18 @@ begin Result := rnd.Next(a, b + 1); end; +function Random(a, b: char) := Chr(Random(integer(a), integer(b))); + function Random(a, b: real): real; begin if a > b then Swap(a, b); Result := a + Random()*(b-a); end; +function Random(diap: IntRange): integer := Random(diap.Low,diap.High); +function Random(diap: RealRange): real := Random(diap.Low,diap.High); +function Random(diap: CharRange): char := Random(diap.Low,diap.High); + function Random := rnd.NextDouble; function Random(MaxValue: real) := Random()*Abs(MaxValue); @@ -8393,8 +8423,14 @@ function Random2(maxValue: real) := (Random(maxValue), Random(maxValue)); function Random2(a, b: integer) := (Random(a, b), Random(a, b)); +function Random2(a, b: char) := (Random(a, b), Random(a, b)); + function Random2(a, b: real) := (Random(a, b), Random(a, b)); +function Random2(diap: IntRange) := Random2(diap.Low,diap.High); +function Random2(diap: RealRange) := Random2(diap.Low,diap.High); +function Random2(diap: CharRange) := Random2(diap.Low,diap.High); + function Random2 := (Random, Random); function Random3(maxValue: integer) := (Random(maxValue), Random(maxValue), Random(maxValue)); @@ -8403,8 +8439,14 @@ function Random3(maxValue: Real) := (Random(maxValue), Random(maxValue), Random( function Random3(a, b: integer) := (Random(a, b), Random(a, b), Random(a, b)); +function Random3(a, b: char) := (Random(a, b), Random(a, b), Random(a, b)); + function Random3(a, b: real) := (Random(a, b), Random(a, b), Random(a, b)); +function Random3(diap: IntRange) := Random3(diap.Low,diap.High); +function Random3(diap: RealRange) := Random3(diap.Low,diap.High); +function Random3(diap: CharRange) := Random3(diap.Low,diap.High); + function Random3 := (Random, Random, Random); diff --git a/bin/PascalABCNET.chm b/bin/PascalABCNET.chm index c64440608..fb3fdbe45 100644 Binary files a/bin/PascalABCNET.chm and b/bin/PascalABCNET.chm differ