generate_random_array
Generate a customizable random array for applications like batch number generation, sampling, test datasets, or task assignments. Specify length, value range, and duplication preferences for tailored results.
Instructions
Random Array Generator
Generate a random array of specified length
Args:
salt (str, optional): Random number salt value. Defaults to "".
array_length (int, optional): Array length. Defaults to 1.
min_value (int, optional): Minimum value. Defaults to 0.
max_value (int, optional): Maximum value. Defaults to 1000000.
allow_duplicates (bool, optional): Allow duplicate values. Defaults to True.
Returns:
str: JSON string containing the random array
Application Scenarios:
1. Batch random number generation
2. Random sampling
3. Test dataset generation
4. Random task assignment
Input Schema
Name | Required | Description | Default |
---|---|---|---|
allow_duplicates | No | ||
array_length | No | ||
max_value | No | ||
min_value | No | ||
salt | No |
Input Schema (JSON Schema)
{
"properties": {
"allow_duplicates": {
"default": true,
"title": "Allow Duplicates",
"type": "boolean"
},
"array_length": {
"default": 1,
"title": "Array Length",
"type": "integer"
},
"max_value": {
"default": 1000000,
"title": "Max Value",
"type": "integer"
},
"min_value": {
"default": 0,
"title": "Min Value",
"type": "integer"
},
"salt": {
"default": "",
"title": "Salt",
"type": "string"
}
},
"title": "generate_random_arrayArguments",
"type": "object"
}