S
Sahibjot Cheema
Guest
I'm want to receive a value between 1 and 6 but if I've already received the value, i'll get a different value.
I want to do this by adding the numbers in a ds_list and then using ds_list_shuffle() to switch up the numbers. Then i can just use the first numbers in the ds_list which will be random.
I've tried making this expect the ds_list_shuffle won't really do anything. Anyone know of a fix to the code or a better way to do this would be greatly appreciated.
I want to do this by adding the numbers in a ds_list and then using ds_list_shuffle() to switch up the numbers. Then i can just use the first numbers in the ds_list which will be random.
I've tried making this expect the ds_list_shuffle won't really do anything. Anyone know of a fix to the code or a better way to do this would be greatly appreciated.
Code:
//Creates a random list
yy = 0;
randomizer = 1;
test = ds_list_create();
var ii = 1;
repeat(tiles_ui.height - 1) {
test[# 0, ii] = ii;
ii++;
}
ds_list_shuffle(test);
while (randomizer != 4) {
yy = irandom_range(0, 8);
if (ds_tiles[# 0, yy] = 0) {
ds_tiles[# 0, yy] = test[# 0, randomizer];
ds_tiles[# 1, yy] = 2;
randomizer++;
}
}