-
Notifications
You must be signed in to change notification settings - Fork 0
/
B.PAS
executable file
·114 lines (105 loc) · 1.89 KB
/
B.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
program b;
uses crt,graph;
var
k,treiber,modus:integer;
v,x,t,dt:real;
wahl:char;
ortx1,ortx2,ortx3:string;
procedure graphik;
begin
treiber:=detect;
initgraph(treiber,modus,'');
setbkcolor(1);
setcolor(15);
line(10,30,630,30);
line(10,450,630,450);
line(10,30,10,450);
line(630,30,630,450);
str(v:4:2,ortx1);
outtextxy(445,380,ortx1);
outtextxy(400,380,'v = m/s');
outtextxy(400,400,'t = s');
outtextxy(400,420,'x = m');
outtextxy(235,15,'Gleichf”rmige Bewegung ');
outtextxy(35,460,'v vergrӇern (V) v verkleinern (v) starten (s) beenden (b)');
end;
procedure setz;
begin
setcolor(15);
str(t:4:2,ortx2);
outtextxy(445,400,ortx2);
str(x:4:2,ortx3);
outtextxy(445,420,ortx3);
setfillstyle(1,12);
sector(120+round(80*x),240,0,360,3,3);
end;
procedure loesch;
begin
setcolor(1);
outtextxy(445,400,ortx2);
outtextxy(445,420,ortx3);
setfillstyle(1,1);
sector(120+round(80*x),240,0,360,3,3);
end;
procedure setz1;
begin
setcolor(15);
str(v:4:2,ortx1);
outtextxy(445,380,ortx1);
end;
procedure loesch1;
begin
setcolor(1);
outtextxy(445,380,ortx1);
end;
procedure auswahl;
begin
wahl:=' ';
repeat
if keypressed then wahl:=readkey;
case wahl of
's':
begin
loesch;
t:=0;
x:=v*t;
setz;
delay(10000);
repeat
loesch;
t:=t+dt;
x:=v*t;
setz;
until x>=5;
wahl:=' ';
end;
'v':
begin
if v>=0.2 then
begin
loesch1;
v:=v-0.1;
setz1;
end;
wahl:=' ';
end;
'V':
begin
loesch1;
v:=v+0.1;
setz1;
wahl:=' ';
end;
end;
until wahl='b';
end;
{MAIN}
begin
v:=1.5;
t:=0;
x:=v*t;
dt:=0.001;
graphik;
setz;
auswahl;
end.