Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 0.93 KB | None | 0 0
  1.   procedure InitJeu(f : in out text_io.file_type; numdefi : in positive; G : out TV_Grille) is
  2.  
  3.     val : integer := 0;
  4.     s : string(1..100);
  5.     lg : natural;
  6.     pos, pos2 : natural := 1;
  7.     col : T_Col;
  8.     lig : T_Lig;
  9.   begin
  10.     reset(f,in_file);
  11.     while not end_of_file(f) and val = numdefi loop
  12.       skip_line(f);
  13.       val := val+1;
  14.     end loop;
  15.     while not end_of_line(f) loop
  16.       get_line(f,s,lg);
  17.       if s(pos..pos) = "j" or s(pos..pos) = "r" then
  18.         pos := pos+8;
  19.       else
  20.         pos := pos+7;
  21.       end if;
  22.       col := s(pos-3);
  23.       lig := integer'value(s(pos-2..pos-1));
  24.       if s(pos2..pos2) = "j" then
  25.         G(lig,col) := (0,jaune);
  26.       elsif s(pos2..pos2) = "r" then
  27.         G(lig,col) := (0,rouge);
  28.       elsif s(pos2..pos2) = "v" then
  29.         G(lig,col) := (0,vert);
  30.       else
  31.         G(lig,col) := (0,bleu);
  32.       end if;
  33.       pos2 := pos;
  34.     end loop;
  35.   end InitJeu;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement