Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Niesynchronizaowane działanie dwóch zadań
- with Ada.Text_IO; use Ada.Text_IO;
- with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
- with RandomPackage; use RandomPackage;
- with MyTime; use MyTime;
- --with Screen; use Screen;
- with WinConsoleEx; use WinConsoleEx;
- Procedure main is
- task Zadaniea;
- task body zadaniea is
- D:Duration;
- czas,czasmax,i:integer;
- Begin
- czasmax:=100;
- i:=1;
- loop
- czas:=RandomInt(czasmax);
- D:=Duration(Float(czas)/100.0);
- delay D;
- MoveCursor(i,10);
- Put("zadaniea");Put(i,2);Put("raz;przerwa");Put(czas,3);
- exit when i=10;
- i:=i+1;
- end loop;
- end Zadaniea;
- task Zadaniea1;
- task body zadaniea1 is
- D:Duration;
- czas,czasmax,i:integer;
- Begin
- czasmax:=100;
- i:=1;
- loop
- czas:=RandomInt(czasmax);
- D:=Duration(Float(czas)/100.0);
- delay D;
- MoveCursor(i,10);
- Put("zadaniea1");Put(i,2);Put("raz;przerwa");Put(czas,3);
- exit when i=10;
- i:=i+1;
- end loop;
- end Zadaniea1;
- begin
- NULL;
- end main;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement