Subversion Repositories svnkaklik

Rev

Rev 278 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 278 Rev 280
Line -... Line 1...
-
 
1
#navaznost na verzi 277
-
 
2
 
1
program Orbis;
3
program Orbis;
2
 
4
 
3
var line, movement, Rychlost;
5
var line, movement, Rychlost;
4
 
6
 
5
#define L 1
7
#define L 1
6
#define S 2
8
#define S 2
7
#define R 3
9
#define R 3
8
 
10
 
9
line:=2;
11
line:=2;
10
 
12
 
11
Rychlost:=15;		# omezeni rychlosti (hlavne pro ladici ucely)
13
Rychlost:=15;		# omezeni rychlosti (hlavne pro ladici ucely)
12
 
14
 
13
while true
15
while true
14
do
16
do
15
  if LEYE = 1 and CEYE = 1 and REYE = 0 then 
17
  if LEYE = 1 and CEYE = 1 and REYE = 0 then 
16
    LMOT:=-1;RMOT:=Rychlost*0.75;			# jed rovne
18
    LMOT:=0;RMOT:=Rychlost;			# jed rovne
17
    line:=1;		# zaznamenej, kdes videl caru
19
    line:=1;		# zaznamenej, kdes videl caru
18
    movement:=1;
20
    movement:=1;
19
    continue;
21
    continue;
20
  end;
22
  end;
21
 
23
 
22
  if LEYE = 0 and CEYE = 1 and REYE = 1 then 
24
  if LEYE = 0 and CEYE = 1 and REYE = 1 then 
23
    LMOT:=Rychlost*0.75;RMOT:=-1;
25
    LMOT:=Rychlost;RMOT:=Rychlost;
24
    line:=3;
26
    line:=3;
25
    movement:=3;
27
    movement:=2;
26
    continue;
28
    continue;
27
  end;
29
  end;
28
 
30
 
29
  if LEYE = 1 and CEYE = 0 and REYE = 0 then 
31
  if LEYE = 1 and CEYE = 0 and REYE = 0 then 
30
    LMOT:=-Rychlost/2;RMOT:=Rychlost;			# jed rovne
32
    LMOT:=0;RMOT:=Rychlost;			# jed rovne
31
    line:=1;		# zaznamenej, kdes videl caru
33
    line:=1;		# zaznamenej, kdes videl caru
32
    movement:=1;
34
    movement:=1;
33
    continue;
35
    continue;
34
  end;
36
  end;
35
 
37
 
36
  if LEYE = 0 and CEYE = 0 and REYE = 1 then 
38
  if LEYE = 0 and CEYE = 0 and REYE = 1 then 
37
    LMOT:=Rychlost;RMOT:=-Rychlost/2;
39
    LMOT:=Rychlost;RMOT:=0;
38
    line:=3;
40
    line:=3;
39
    movement:=3;
41
    movement:=3;
40
    continue;
42
    continue;
41
  end;
43
  end;
42
 
44
 
43
  if (LEYE = 0 and CEYE = 1 and REYE = 0) then 
45
  if (LEYE = 0 and CEYE = 1 and REYE = 0) then 
44
    LMOT:=Rychlost;RMOT:=Rychlost;
46
    LMOT:=Rychlost;RMOT:=Rychlost;
45
    line:=2;
47
    line:=2;
46
    movement:=2;
48
    movement:=2;
47
    continue;
49
    continue;
48
  end;
50
  end;
49
 
51
 
50
  if (LEYE = 1 and CEYE = 1 and REYE = 1) then 
52
  if (LEYE = 1 and CEYE = 1 and REYE = 1) then 
51
    if movement = 1 then
-
 
52
      LMOT:=Rychlost;RMOT:=0;
-
 
53
      line:=2;
-
 
54
#      break;
-
 
55
 
-
 
56
    elif movement = 2 then
-
 
57
      LMOT:=Rychlost;RMOT:=Rychlost;
53
    LMOT:=0;RMOT:=Rychlost;
58
      line:=2;
54
    line:=2;
59
#      break;
-
 
60
 
-
 
61
    elif movement = 3 then
-
 
62
      LMOT:=0;RMOT:=Rychlost;
-
 
63
      line:=2;
55
    movement:=1;
64
    end;
56
    continue;
65
  end;
57
  end;
66
 
58
 
67
  if (LEYE = 0 and CEYE = 0 and REYE = 0) then 
59
  if (LEYE = 0 and CEYE = 0 and REYE = 0) then 
68
    if line = 1 then
-
 
69
      LMOT:=0;RMOT:=Rychlost;
-
 
70
      line:=2;
-
 
71
      movement:=1;
-
 
72
 
-
 
73
    elif movement = 3 then
-
 
74
      LMOT:=Rychlost;RMOT:=0;
60
      LMOT:=Rychlost;RMOT:=0;
75
      line:=2;
61
      line:=2;
76
      movement:=3;
62
      movement:=3;
77
    end;
-
 
78
  end;    
63
  end;    
79
end;
64
end;