(* Générateur de fichiers porciques au format slx *)

#open "sys";; 

chdir "c:/mesdoc~1/infosp~1/td/analys~1/excell";; (* à adapter... *)



let create_porky_file n name=
  let file=open_out (name^".slx") in
    for i=1 to random__int (1000*n) do
      for j=1 to random__int 50 do 
	output_char file (char_of_int (32+(random__int 223))) done;
      output_char file `\n`  done;
    output_string file "Nb eleves : ";
    for i=1 to random__int 50 do output_char file ` ` done;
    output_binary_int file n;
    for i=1 to n do 
      for j=1 to random__int 100 do
      for k=1 to random__int 50 do 
	output_char file (char_of_int (32+(random__int 223))) done;
      output_char file `\n`  done;
      output_string file "Nom :";
      for j=1 to random__int 10 do output_char file ` ` done;
      for j=2 to (2+random__int 15) do
	output_char file (char_of_int (65+(random__int 25))) done;
      for j=1 to (1+(random__int 10)) do output_char file ` ` done;
      output_string file "Note :";
      for j=1 to random__int 10 do output_char file ` ` done;
      output_binary_int  file (random__int 21);
      output_char file `\n`;
    done;
    close_out file;;



create_porky_file 50 "azertyu";;