C
Un simplu program muzical in CUn simplu program muzical #include <stdio.h> #include <dos.h> #include <conio.h> main(); int i,j,nr_octava,i_nota,timp=500; float masura,durata,durata_masura; char *linia='42$2R2R4M4F2O2L1R2R2S2S4L4O2O2'; //$4D2D4$3S4L2'; do break; case 'D' : i_nota=0;break; case 'd' : i_nota=1;break; case 'R' : i_nota=2;break; case 'r' : i_nota=3;break; case 'M' : i_nota=4;break; case 'F' : i_nota=5;break; case 'f' : i_nota=6;break; case 'O' : i_nota=7;break; case 'o' : i_nota=8;break; case 'L' : i_nota=9;break; case 'l' : i_nota=10;break; case 'S' : i_nota=11;break; } } else sound(nr_octava*octava[i_nota]); delay(durata*timp); } /* else */ } /* for */ /* do */ while (!kbhit()); nosound();
|