IoannisMDamalas / Project-Stardust

First Project of Programming II
1 stars 0 forks source link

Chapter 5: Movements & Consequences #8

Open IoannisMDamalas opened 5 months ago

IoannisMDamalas commented 5 months ago
DrBoost32 commented 5 months ago

We'll use the function rand() and divide it in 4 equal parts, we'll make it so each part is detected as a direction for the stormtroopers and then as it checks if the stormtrooper is allowed to move on that direction, if he's not allowed to then we simply goto rand() and draw another number from 1 of the 4 parts and repeat until a valid number appears