Advertisement
Guest User

Untitled

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