%shuffle

loops=1000;

store=zeros(loops,loops);

for d=1:loops

cardsd=linspace(1,52,52);

for a=1:loops

fromfront=random('unid',25);

fromback=random('unid',25);

front=cardsd(1:fromfront);

back=cardsd(end-fromback:end);

middle=cardsd(fromfront+1:end-fromback-1);

cardsd=[back,middle,front];

unshove=diff(cardsd);

ind=find(unshove==1);

[b,c]=size(ind);

store(a,d)=c;

end

end

store=store';