-
Notifications
You must be signed in to change notification settings - Fork 10
Standard library
Limits the value to a range with an upper and a lower bound.
Overrides:
clamp:int (value:int min:int max:int)
clamp:float (value:float min:float max:float)
clamp:long (value:long min:long max:long)
clamp:double (value:double min:double max:double)
Throws a new Exception
with given message.
fail:unit (msg:string)
Formats a string. Is a shorthand to string::Format
.
fmt:string (s:string x1:obj...)
Prints a string to the console with optional formatting. Is a shorthand for Console::Write
.
Prints a string to the console with optional formatting and a newline character. Is a shorthand for Console::WriteLine
.
Returns a random value.
Overrides:
-
rand:double
- returns a random double from0.0
to1.0
-
rand:int (max:int)
- return a randomint
from0
tomax
-
rand:int (min:int max:int)
- return a randomint
frommin
tomax
-
rand:T (src:IList<T>)
- return a random item from the collection -
rand:T (src:IList<T> w:Func<T, double>)
- return a random item from the collection by a weighter function
Reads a single character from the console and returns its character key. Is a shorthand for Console::Read
.
read:int
Reads a single keypress from the console. The key is displayed. Is a shorthand for Console::ReadKey (false)
.
readkey:ConsoleKeyInfo
Reads a string from the console until a newline character is entered. Is a shorthand for Console::ReadLine
.
readln:string
An extension method for invoking a lambda several times.
Overrides:
times:unit (x:int act:Action)
-
times:unit (x:int act:Action<int>)
- accepts the index
Returns a sequential range of values between two points. A step can also be provided.
Overrides:
to:IEnumerable<int> (from:int to:int)
to:IEnumerable<int> (from:int to:int step:int)
to:IEnumerable<string> (from:string to:string)
to:IEnumerable<string> (from:string to:string step:int)
Is used as an extension method:
let nums = 1.to 10
let chars = "A".to "Z"
For the string
overrides, the from
and to
arguments must be one-character strings. Otherwise an ArgumentException
is issued!
Reads a single keypress from the console. The key is not displayed. Is a shorthand for Console::ReadKey (true)
.
readkey:ConsoleKeyInfo