Random() not being random

So basically i wanted a random number ranging from 0 to 1 so i can give a random location to an object i tried using:

"int obstacle location = 1;
obstacle location = random(0, 2);".
And it is giving me numbers from the range i wanted but its always the same sequence it always gives me :
1
1
1
1
0
0
0
0
0
1
1
0
1

Then i reboot everything and try to run it again and i get :
1
1
1
1
0
0
0
0
0
1
1
0
1

Again the same sequence, any idea on how to solve this problem or is there another way around it?

It's been bugging me all morning >:(

Take a look at the documentation Random paying particular attention to the remarks concerning randomSeed.

thx man i've read it all and i did it its working just fine now