Wirehead Studios

General Discussion => Off-Topic => Topic started by: games keeper on 2004-01-06, 17:22



Title: whats wrong with my program (it doesnt work)
Post by: games keeper on 2004-01-06, 17:22
the next program works fine in school where I work on an old DOS version of c++
but here at home it doesnt work and it doesnt know the sound commands .


my c++ version is 3.1

/*
oeffor24.CPP
Bepaal random 10 oefening op de tafels van vermenigvuldiging en geef een beoordeling .
*/
#include
#include
#include
#include
#include
#include

void main()
{
clrscr();
int a,b ,aantal, uitkomst,punten=0;

randomize();

cout << "\nrekenprograma voor beginners " ;


   for (aantal=1   ; aantal <= 10 ; aantal=aantal+1)
   {
   a=random(10)+1 ;
   b=random(10)+1 ;
   gotoxy(3,aantal);
   cout << setw(3)<< "\n\n\n\n" << a << "*"<< b << " = " ;
   cin >> uitkomst ;

      if ( uitkomst == a*b )
      {
      gotoxy(15,aantal);
      textcolor(2);
      cprintf ("\n\n\n\njuist");
      sound(2000);
      delay(100);
      nosound();
      punten=punten+1  ;
      }
      else
      {
      gotoxy(15,aantal);
      textcolor(4);
      cprintf ("\n\n\n\nfout") ;
      sound(500);
      delay(100);
      nosound();

      }
}
cout << "\n U hebt "<< punten << "/10 gescoort" ;
         if (punten ==10)
         {
         sound(200) ;
         delay(100) ;
         sound(400) ;
         delay(200) ;
         sound(800) ;
         delay(400) ;
         sound(1600);
         delay(800) ;
         nosound()  ;
         }


getch();
}



Title: Re: whats wrong with my program
Post by: Phoenix on 2004-01-07, 01:43
I'd wager that the libraries between your C++ compilers might be different.  Have you checked the make sure all the included header files are the same on each system?


Title: Re: whats wrong with my program
Post by: games keeper on 2004-01-07, 12:34
thank you pho for solving my problem .

bah , now I have to downloa thecomplete school his librarys .


Title: Re: whats wrong with my program
Post by: [WaRdeN] on 2004-01-07, 14:46
ffs that's what I told you in IRC GamesKeeper


Title: Re: whats wrong with my program
Post by: games keeper on 2004-01-07, 14:49
then thank you 2 warden .