This is what I've got so far if it helps.
integer:: n
parameter(n=10)
integer:: i,t,h
real:: s
integer, dimension(n) :: x
do i=1,n/2
x(i)=1
end do
do i=n/2+1,n
x(i)=-1
end do
print '(10i2)',x
do i=1,n
call random_number(s)
s=n*s
do h=0,n-1
if(s.gt.h.and.s.lt.h+1) t=h+1
end do
x(i)=x(t)
x(t)=x(i)
print*,x(i)
end do