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 := 1;
- s : string(1..100);
- lg : natural;
- pos, pos2 : natural := 1;
- col : T_Col;
- lig : T_Lig;
- begin
- reset(f,in_file);
- while val /= numdefi loop
- skip_line(f);
- val := val+1;
- end loop;
- get_line(f,s,lg);
- while pos < lg loop
- if s(pos) = 'j' or s(pos) = 'r' then
- pos := pos+9;
- else
- pos := pos+8;
- end if;
- if pos < lg then
- col := s(pos-3);
- lig := integer'value(s(pos-2..pos-1));
- else
- col := s(lg-1);
- lig := integer'value(s(lg..lg));
- end if;
- if s(pos2) = 'j' then
- G(lig,col) := (0,jaune);
- elsif s(pos2) = 'r' then
- G(lig,col) := (0,rouge);
- elsif s(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