|
ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Testing > Procedures > Running procedures > Errors and warnings while running a procedure > Warning: The 'Randomise array' function failed Warning: The 'Randomise array' function failed
DescriptionThe 'Randomise array' function is used to shuffle the contents of an array variable. There is a variant of this function that allows you to limit the maximum number of consecutive values that can be the same, but if ANY-maze cannot meet these criteria, this warning will be generated at run-time. More informationThe Randomise array statement can specify the maximum number of consecutive values in the array that can be the same. So if, for example, you had an array of ten True/False values (five True, and five False) and asked ANY-maze to randomise this with a maximum repeat count of 3, ANY-maze could generate the array 'True, True, False, True, True, False, True, False, False, False' but not the array 'False, False, True, False, True, True, True, True, False, False' (because it contains more than 3 consecutive values of 'True'). ANY-maze will attempt a number of randomizations of the given array, and will check for consecutive values each time it does. If it cannot generate an array without the specified number of consecutive values, this run-time warning will be generated and the array will be left in the last randomised state which was attempted. Note that the most common reason for this warning is failing to initialise the array correctly, which will leave it containing all zeros - in which case all the values in the array are the same, and therefore it is impossible to randomize the array without finding the specified number of consecutive values! See also:
© Copyright 2003-2026 Stoelting Co. All rights reserved ANY-maze help topic T0532 |