+ 2
How can I set an int's value to be a rand int ?
I want to set c = rand int i.e ft||em...how can I set that ? https://code.sololearn.com/cNvBzo6OVa3F/?ref=app
3 Answers
+ 4
if(rand() % 2 <= 1)
c = ft
else
c = em;
~~ or ~~
c = rand() % 2 <= 1 ? ft : em;
+ 2
Thanks a lot .....Now I can set the moves to random !! đđđđđđ
+ 1
Then what is its alternative ?