# Randomize

Seeds the pseudo-random number generator with an integer number, ensuring repeatable number patterns.

## Method Signature

```
Randomize(seed=[numeric], algorithm=[string])
```

### Arguments

| Argument    | Type      | Required | Description                                         | Default |
| ----------- | --------- | -------- | --------------------------------------------------- | ------- |
| `seed`      | `numeric` | `true`   | The number to seed the Random with                  |         |
| `algorithm` | `string`  | `false`  | The algorithm to use to generate the random number. |         |

## Examples

### Tag Example

The following example calls the Randomize function to seed the random number generator and generates 10 random numbers.

```java
<bx:set randomize( 12345 ) > <!--- if one was to remove this line, the random numbers are different every time --->  
 <bx:loop index="i" from="1" to="10"> 
 <bx:output>#rand()#</bx:output> 
 </bx:loop> 
```

### Additional Examples

```java
writeDump( Randomize( 8, "SHA1PRNG" ) );
writeDump( Randomize( 10 ) >= 0 && Randomize( 10 ) <= 1 );
randomize( 55 );
bx:loop index="i" from="1" to="3" {
	writeDump( rand() );
}

```

## Related

* [Abs](/boxlang-language/reference/built-in-functions/math/abs.md)
* [Acos](/boxlang-language/reference/built-in-functions/math/acos.md)
* [Asin](/boxlang-language/reference/built-in-functions/math/asin.md)
* [Atn](/boxlang-language/reference/built-in-functions/math/atn.md)
* [Ceiling](/boxlang-language/reference/built-in-functions/math/ceiling.md)
* [Cos](/boxlang-language/reference/built-in-functions/math/cos.md)
* [DecrementValue](/boxlang-language/reference/built-in-functions/math/decrementvalue.md)
* [Exp](/boxlang-language/reference/built-in-functions/math/exp.md)
* [Fix](/boxlang-language/reference/built-in-functions/math/fix.md)
* [Floor](/boxlang-language/reference/built-in-functions/math/floor.md)
* [FormatBaseN](/boxlang-language/reference/built-in-functions/math/formatbasen.md)
* [IncrementValue](/boxlang-language/reference/built-in-functions/math/incrementvalue.md)
* [InputBaseN](/boxlang-language/reference/built-in-functions/math/inputbasen.md)
* [Int](/boxlang-language/reference/built-in-functions/math/int.md)
* [Log](/boxlang-language/reference/built-in-functions/math/log.md)
* [Log10](/boxlang-language/reference/built-in-functions/math/log10.md)
* [Max](/boxlang-language/reference/built-in-functions/math/max.md)
* [Min](/boxlang-language/reference/built-in-functions/math/min.md)
* [Pi](/boxlang-language/reference/built-in-functions/math/pi.md)
* [PrecisionEvaluate](/boxlang-language/reference/built-in-functions/math/precisionevaluate.md)
* [Rand](/boxlang-language/reference/built-in-functions/math/rand.md)
* [RandRange](/boxlang-language/reference/built-in-functions/math/randrange.md)
* [Round](/boxlang-language/reference/built-in-functions/math/round.md)
* [Sgn](/boxlang-language/reference/built-in-functions/math/sgn.md)
* [Sin](/boxlang-language/reference/built-in-functions/math/sin.md)
* [Sqr](/boxlang-language/reference/built-in-functions/math/sqr.md)
* [Tan](/boxlang-language/reference/built-in-functions/math/tan.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/randomize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
