clear all;

IDs=zeros(200,8)
for k=1:8
IDs(:,k)=rand(200,1)*8+1;
%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.                                                                      
end
IDs=round(IDs);

for h=1:200
IDstr=num2str(IDs(h,:));
IDstr=strrep(IDstr,' ','');
IDmat{h}=IDstr;
end


cd('F:\users\Peter\presentation\webrating\IDmovies\');
for i=1:200
    filename=['ID',num2str(i),'.txt'];
    fid=fopen(filename,'wt');
    fprintf(fid,'%s',IDmat{i});
    fclose(fid);
end
fid=fopen('F:\users\Peter\presentation\webrating\validmovieIDs.txt','wt');
ordervec=randperm(200);
for i=1:length(IDmat)
    fprintf(fid,[IDmat{ordervec(i)},'\n']);
end
fclose(fid);