Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure InitJeu(f : in out text_io.file_type; numdefi : in positive; G : out TV_Grille) is
- val : integer := 0;
- s : string(1..100);
- lg : natural;
- pos, pos2 : natural := 1;
- col : T_Col;
- lig : T_Lig;
- begin
- reset(f,in_file);
- while not end_of_file(f) and val = numdefi loop
- skip_line(f);
- val := val+1;
- end loop;
- while not end_of_line(f) loop
- get_line(f,s,lg);
- if s(pos..pos) = "j" or s(pos..pos) = "r" then
- pos := pos+8;
- else
- pos := pos+7;
- end if;
- col := s(pos-3);
- lig := integer'value(s(pos-2..pos-1));
- if s(pos2..pos2) = "j" then
- G(lig,col) := (0,jaune);
- elsif s(pos2..pos2) = "r" then
- G(lig,col) := (0,rouge);
- elsif s(pos2..pos2) = "v" then
- G(lig,col) := (0,vert);
- else
- G(lig,col) := (0,bleu);
- end if;
- pos2 := pos;
- end loop;
- end InitJeu;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement