Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

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