-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC.PAS
executable file
·136 lines (126 loc) · 2.28 KB
/
C.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
program c;
uses crt,graph;
var
k,treiber,modus:integer;
v,x,t,dt:real;
wahl1,wahl:char;
ortx1,ortx2,ortx3:string;
procedure menue;
begin
treiber:=detect;
initgraph(treiber,modus,'');
setbkcolor(7);
setcolor(1);
outtextxy(150,200,'Geradlinig gleichf”rmige Bewegung -> 1');
outtextxy(400,400,'beenden -> b');
end;
procedure graphik;
begin
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(50,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;
procedure bewegung;
begin
cleardevice;
v:=1.5;
t:=0;
x:=v*t;
dt:=0.001;
graphik;
setz;
auswahl;
menue;
end;
{MAIN}
begin
wahl1:=' ';
menue;
repeat
wahl1:=' ';
if keypressed then wahl1:=readkey;
case wahl1 of
'1':bewegung;
end;
until wahl1='b';
end.