Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
282 kaklik 1
program Orbis;
2
 
3
var line, Rychlost, Reverz, Zataceni;
4
var Rovinka, a;
5
 
6
#define L 1
7
#define S 2
8
#define R 3
9
 
10
line:=2;
11
Rovinka:=0;
12
 
13
Rychlost:=30;		# omezeni rychlosti (hlavne pro ladici ucely)
14
Reverz := 1;
15
Zataceni := 0.75;
16
 
17
while true
18
do
19
  if LEYE = 1 and CEYE = 1 then		# Cara pod levim sensorem
20
    if line = 2 then
21
      a:=TIME;
22
      LMOT:=-Rychlost; RMOT:=-Rychlost;
23
      while TIME < (a + Reverz) do;
24
    end;
25
    if line = 3 then
26
      a:=TIME;
27
      RMOT:=-Rychlost;
28
      while TIME < (a + Reverz) do;
29
    end;
30
    LMOT:=0;RMOT:=Rychlost*Zataceni;			
31
    line:=1;		# zaznamenej, kdes videl caru
32
    Rovinka:=0;
33
    continue;
34
  end;
35
 
36
  if REYE = 1 and CEYE = 1 then
37
   if line = 1 then
38
      a:=TIME;
39
      LMOT:=-Rychlost;RMOT:=-Rychlost;
40
      while TIME < (a+Reverz) do;
41
   end;
42
   if line = 1 then
43
      a:=TIME;
44
      LMOT:=-Rychlost;
45
      while TIME < (a+Reverz) do;
46
   end;
47
    LMOT:=Rychlost*Zataceni;RMOT:=0;
48
    line:=3;
49
    Rovinka:=0;
50
    continue;
51
  end;
52
 
53
  if CEYE = 1 then 
54
    LMOT:=Rychlost;RMOT:=Rychlost;
55
    line:=2;
56
    Rovinka:= Rovinka +1;
57
    continue;
58
  end;
59
end;