Description

Par terrible pour un piano mais bon...

Source / Exemple :


/*

  • OBJET: PIANO
  • ~~~~~~
  • /
#include <stdio.h> #include <conio.h> #include <alloc.h> #include <dos.h> void interface(int oktawe,int during); void main(void) { char note; int duree=200,i,octave=1; int t[26],test; textbackground(BLUE); textcolor(YELLOW); clrscr(); for(i=0;i<26;i++) { t[i]=500+(40*i); } note=(char)malloc(sizeof(char)); interface(octave,duree); while(note!='0') { cscanf(" %c",&note); switch(note) { case 'a':i=0;break; case 'z':i=1;break; case 'e':i=2;break; case 'r':i=3;break; case 't':i=4;break; case 'y':i=5;break; case 'u':i=6;break; case 'i':i=7;break; case 'o':i=8;break; case 'p':i=9;break; case 'q':i=10;break; case 's':i=11;break; case 'd':i=12;break; case 'f':i=13;break; case 'g':i=14;break; case 'h':i=15;break; case 'j':i=16;break; case 'k':i=17;break; case 'l':i=18;break; case 'm':i=19;break; case 'w':i=20;break; case 'x':i=21;break; case 'c':i=22;break; case 'v':i=23;break; case 'b':i=24;break; case 'n':i=25;break; default:break; } if(note!='0'&&note!='1'&&note!='2') { sound(t[i]); delay(duree); nosound(); } if(note=='2') { octave++; for(i=0;i<26;i++) { t[i]=t[i]+(40*i); } interface(octave,duree); } if(note=='3') { octave--; for(i=0;i<26;i++) { t[i]=t[i]-(40*i); } interface(octave,duree); } if(note=='1') { cprintf("\n\rNouvelle duree: "); scanf(" %d",&duree); interface(octave,duree); } gotoxy(1,18); delline(); printf("\b"); } } void interface(int oktawe,int during) { clrscr(); textbackground(BLUE); textcolor(YELLOW); cprintf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n\r"); cprintf(" º"); textcolor(LIGHTMAGENTA); cprintf("DUREE: %d ms\n\r",during); textcolor(YELLOW); cprintf(" º"); textcolor(LIGHTCYAN); cprintf("OCTAVE nø %d\n\r",oktawe); textcolor(YELLOW); cprintf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n\r"); cprintf(" ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ¿\n\r"); cprintf(" ³DO 1#a ³RE 1#z ³MI 1#e ³FA 1#r ³SOL 1#t³LA 1#y ³SI 1#u ³\n\r"); cprintf(" ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ´\n\r"); cprintf(" ³DO 2#i ³RE 2#o ³MI 2#p ³FA 2#q ³SOL 2#s³LA 2#d ³SI 2#f ³\n\r"); cprintf(" ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ´\n\r"); cprintf(" ³DO 3#g ³RE 3#h ³MI 3#j ³FA 3#k ³SOL 3#l³LA 3#m ³SI 3#w ³\n\r"); cprintf(" ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄ´\n\r"); cprintf(" ³DO 4#x ³RE 4#c ³MI 4#v ³FA 4#b ³SOL 4#n³ ³\n\r"); cprintf(" ÃÄÄÄÄÄÄÄÁÄÄÂÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÂÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄ´\n\r"); cprintf(" ³"); textcolor(WHITE); cprintf(" 1: DUREE "); textcolor(YELLOW); cprintf("³ "); textcolor(LIGHTGREEN); cprintf("2: + 1 OCTAVE "); textcolor(YELLOW); cprintf("³ "); textcolor(LIGHTGREEN); cprintf("3: - 1 OCTAVE "); textcolor(YELLOW); cprintf("³ "); textcolor(LIGHTRED); cprintf("0: QUITTER "); textcolor(YELLOW); cprintf("³\n\r"); cprintf(" ÀÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÙ\n\r"); gotoxy(63,2); cprintf(" º\n\r"); gotoxy(63,3); cprintf(" º\n\r"); gotoxy(1,18); }

Conclusion :


Marche sous Borland 3.0 les autres je sais pas, c'est pourquoi j'envoie l'EXE

Codes Sources

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.