emodanielek
Nowy
Dołączył: 21 Maj 2012
Posty: 1
Przeczytał: 0 tematów
Ostrzeżeń: 0/5
|
Wysłany: Pon 16:19, 21 Maj 2012 Temat postu: Turbo pascal - organki - automatyczny enter |
|
|
procedure gramy;
var
c,d,e,f,g,a,h,cc,q,y,k:integer;
d2,e2,f2,g2,a2,h2,cc2:integer;
x:char;
begin
clrscr;
tlo;
c:=131;{c}
d:=147;{d}
e:=165;{e}
f:=175;{f}
g:=196;{g}
a:=220;{a}
h:=247;{h}
cc:=262;{c}
d2:=294;{d}
e2:=330;{e}
f2:=349;{f}
g2:=392;{g}
a2:=440;{a}
h2:=494;{h}
cc2:=523;{c}
begin
clrscr;
repeat
gotoxy(3,2);
readln(x);
if x='w' then
sound(c);
delay(50);
nosound;
if x='e' then
sound(d);
delay(200);
nosound;
if x='r' then
sound(e);
delay(200);
nosound;
if x='t' then
sound(f);
delay(200);
nosound;
if x='y' then
sound(g);
delay(200);
nosound;
if x='u' then
sound(a);
delay(200);
nosound;
if x='i' then
sound(h);
delay(200);
nosound;
if x='o' then
sound(cc);
delay(200);
nosound;
if x='p' then
sound(d2);
delay(200);
nosound;
if x='a' then
sound(e2);
delay(200);
nosound;
if x='s' then
sound(f2);
delay(200);
nosound;
if x='d' then
sound(g2);
delay(200);
nosound;
if x='f' then
sound(a2);
delay(200);
nosound;
if x='g' then
sound(h2);
delay(200);
nosound;
if x='h' then
sound(cc2);
delay(200);
nosound;
until x='q';
end;
wyżej program który chciałbym zrobić choć nie do końca wygląda tak jakbym chciał i oto problem :
jak mam zrobić organy które klikając w klawiaturę od razu by grały ?
teraz jak wyżej muszę za każdym razem każdą literkę potwierdzać ENTEREM co jest raczej nie fajne ;x i oczywiście czas oczekiwania na pobranie drugiej literki też jest długi
może mi ktoś pomoże ?
Post został pochwalony 0 razy
|
|