Subversion Repositories svnkaklik

Rev

Rev 276 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

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