if someBoolTellingThatWeAllreadyDidThisOnce == false:
rand = random number between range_start and range_end
else
rand = random number between range_start and range_end - 1
if (rand >= lastNumber) rand++
lastNumber = rand
Ok! Ty!All he asked for was that the random number to not be displayed twice in a row. Otherwise I would've made it for more.
Edit: i redid the code to fix that small bug.
- random non repeating number
- Events
- Player - Player 1 (Red) skips a cinematic sequence
- Conditions
- Actions
- Set tempInt[1] = (Random integer number between 1 and 2)
- Set tempInt[2] = randomIntegerArray[tempInt[1]]
- Game - Display to (All players) the text: (String(tempInt[2]))
- Set randomIntegerArray[tempInt[1]] = randomIntegerArray[3]
- Set randomIntegerArray[3] = tempInt[2]
I was going to trash dimf's suggestion and I saw that it uses Indexed array XD
|
|
u shouldnt use integer A/B maker its slower and less efficient.
Efficient nazi hahaha