Subversion Repositories svnkaklik

Rev

Rev 279 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 279 Rev 282
Line 1... Line -...
1
# naportovany algoritmus Callis, ovsem nefunguje.
-
 
2
program Callis;
1
program Orbis;
3
 
2
 
4
var movement, line;
3
var line, Rychlost, Zataceni;
5
 
4
 
6
#define L 1
5
#define L 1
7
#define S 2
6
#define S 2
8
#define R 3
7
#define R 3
9
 
8
 
10
line:=2;
9
line:=2;
11
 
10
 
-
 
11
Rychlost:=15;		# omezeni rychlosti (hlavne pro ladici ucely)
-
 
12
Zataceni:=0.75;
-
 
13
 
12
while true
14
while true
13
do
15
do
14
  if LEYE > 0 or CEYE > 0 then		# Cara pod levim sensorem
16
  if LEYE = 1 and CEYE = 1 then		# Cara pod levim sensorem
15
    LMOT:=30;RMOT:=30;	# jed rovne
17
    LMOT:=0;RMOT:=Rychlost*Zataceni;			# jed rovne
16
    line:=1;		# zaznamenej, kdes videl caru
18
    line:=1;		# zaznamenej, kdes videl caru
17
    continue;
19
    continue;
18
  end;
20
  end;
19
 
21
 
20
  if REYE > 0 or CEYE > 0 then
22
  if REYE = 1 and CEYE = 1 then
21
    LMOT:=30;RMOT:=30;
23
    LMOT:=Rychlost*Zataceni;RMOT:=0;
22
    line:=3;
24
    line:=3;
23
    continue;
25
    continue;
24
  end;
26
  end;
-
 
27
 
-
 
28
  if CEYE = 1 then 
-
 
29
    LMOT:=Rychlost;RMOT:=Rychlost;
-
 
30
    line:=2;
-
 
31
    continue;
-
 
32
  end;
25
  
33
  
26
  if line=1 then 
34
  if LEYE = 0 and CEYE = 0 and REYE = 0 then 
27
    LMOT:=0;
35
    LMOT:=Rychlost;RMOT:=0;
28
    movement:=1;
-
 
29
    break;
-
 
30
 
-
 
31
  elif line=3 then
-
 
32
    RMOT:=0;
36
    line:=2;
33
    movement:=3;
37
    continue;
34
    break;
-
 
35
  end;
38
  end;
-
 
39
 
36
end;
40
end;