EXTREME Overclocking Forums
Home | Reviews | Forums | Downloads | $ EXTREME Deals $ | RealTime Pricing | Free Magazines | Gear | Folding Stats Newsletter | Contact Us


Go Back   EXTREME Overclocking Forums > Software Discussion > Programming, DBMS, HTML, Web Related
Register Forum Rules FAQ Search Today's Posts Mark Forums Read

Welcome Guest Visitor! Please Register, It's Free and Fun To Participate!
The EXTREME Overclocking Forums are a place for people to learn how to overclock and tweak their PC's components like the CPU, memory (RAM), or video card in order to gain the maximum performance out of their system. There are lots of discussions about new processors, graphics cards, cooling products, power supplies, cases, and so much more!

You are currently viewing our boards as a "guest" which gives you limited access to view most discussions. You need to register before you can post: click the register link to proceed. Before you register, please read the forum rules. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own pictures, and access many other special features. Registration is fast, simple, and absolutely free! To start viewing messages, select the forum that you want to visit from the selection below.

After you have registered and read the forum rules, you can check out the FAQ for more information on using the forum. We hope you enjoy your stay here!

Note To Spammers: We do not allow unsolicited advertising! Spam is usually reported & deleted within minutes of it being posted, so don't waste your time (or ours)!


Please Register to Post a Reply
 
Thread Tools
Old 12-08-2006, 05:45 AM   #1
mdawg
O ryl? Ya rly.
mdawg's Avatar
Senior Member
 
Posts: 1,530
Last Seen: 02-04-2010
Age: 20
From: Kingsport, TN
iTrader: 5 / 100%
C ++ Cant get this to compile

Alright this is a game I found, I am doing a project in C++ right now and Im trying to use some functions from this game but they just wont compile in Dev c++ or borland. The main thing thats giving me problems is the sleep() function. Can someone help me fix this only using Dev C ++ or Borland? Thanks for any input.

Also all the background colors wont work in Dev but they dont show up as errors in Borland. Im clueless on what I should do.

Quote:
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <iostream.h>
#include <iomanip.h>
void main()
{
int i, j, r, c, s, main;
char ans, opt;
menu:
textbackground(BLUE);
textcolor(YELLOW + BLINK);
clrscr();
textbackground(BLUE);
textcolor(YELLOW + BLINK);
do
{
gotoxy(24, 6);
printf("%c", 15);
gotoxy(33, 4);
printf("%c", 15);
gotoxy(40, 6);
printf("%c", 15);
gotoxy(50, 5);
printf("%c", 15);
gotoxy(60, 7);
printf("%c", 15);
gotoxy(70, 3);
printf("%c", 15);
gotoxy(18, 2);
printf("%c", 15);
gotoxy(7, 6);
printf("%c", 15);
gotoxy(18, 9);
printf("%c", 15);
gotoxy(63, 11);
printf("%c", 15);
gotoxy(20, 14);
printf("%c", 15);
gotoxy(57, 14);
printf("%c", 15);
//B
for(i = 8; i <= 12; i++)
{
gotoxy(26, i);
printf("%c", 173);
gotoxy(30, i);
printf("%c", 173);
}
for(i = 8; i <= 12; i = i + 2)
{
gotoxy(27, i);
printf("%c%c%c", 173, 173, 173);
}
//O
for(i = 8; i <= 12; i++)
{
gotoxy(33, i);
printf("%c", 173);
gotoxy(37, i);
printf("%c", 173);
}
for(i = 8; i <= 12; i = i + 4)
{
gotoxy(34, i);
printf("%c%c%c", 173, 173, 173);
}
//M
for(i = 8; i <= 12; i++)
{
gotoxy(40, i);
printf("%c", 173);
gotoxy(42, i);
printf("%c", 173);
gotoxy(44, i);
printf("%c", 173);
}
gotoxy(41, 8);
printf("%c", 173);
gotoxy(43, 8);
printf("%c", 173);
//B
for(i = 8; i <= 12; i++)
{
gotoxy(47, i);
printf("%c", 173);
gotoxy(51, i);
printf("%c", 173);
}
for(i = 8; i <= 12; i = i + 2)
{
gotoxy(48, i);
printf("%c%c%c", 173, 173, 173);
}
gotoxy(28, 15);
printf("T H E G A M E");
gotoxy(28, 19);
printf("1. New Game");
gotoxy(28, 20);
printf("2. Instructions.");
gotoxy(28, 21);
printf("3. Exit");
opt = getche();
if(opt == '1')
{
clrscr();
textbackground(BLUE);
textcolor(YELLOW + BLINK);
printf("ENTER THE SPEED WITH WHICH YOU WANT YOUR AEROPLANE TO MOVE ( > than 0 and < than 100): ");
scanf("%d", &s);
for(main = 1; main <= 3; main++)
{
clrscr();
textbackground(BLUE);
textcolor(YELLOW + BLINK);
gotoxy(37, 20);
printf("%c", 219);
gotoxy(1, 2);
printf(">%c--->", 173);
getch();
while(!kbhit())
{
for(i = 1; i < 75; i++)
{
if(kbhit())
{
getch();
nosound();
goto drop;
}
else
{
gotoxy(i, 2);
printf(">%c--->", 173);
r = 2;
c = i;
gotoxy(37, 20);
printf("%c", 219);
sound(100);
delay(100 - s);
if(i != 36 && !kbhit())
{
clrscr();
textbackground(BLUE);
textcolor(YELLOW + BLINK);
}
}
}
}
drop:
for(j = 3; j <= 20; j++)
{
gotoxy(c, r);
printf(">---->");
gotoxy(37, 20);
printf("%c", 219);
gotoxy(i, j);
printf("%c", 173);
delay(50);
sound(3000);
if(j != 15)
{
clrscr();
textbackground(BLUE);
textcolor(YELLOW + BLINK);
}
}
nosound();
if(i == 37)
{
gotoxy(34, 20);
printf("%cBOOM!!!%c", 15, 15);
gotoxy(29, 21);
//delay(100);
printf("%c %c %c", 15, 15, 15);
gotoxy(33, 19);
//delay(100);
printf("%c %c", 15, 15);
for(i = 0; i < 10; i++)
{
delay(30);
sound((i * 100) + 50);
delay(30);
nosound();
}
getch();
clrscr();
textbackground(BLUE);
textcolor(YELLOW + BLINK);
break;
}
else
{
gotoxy(i, 20);
clreol();
gotoxy(30, 15);
printf("SORRY, YOU MISSED THE TARGET");
sound(2000);
delay(100);
nosound();
}
getch();
}
}
}
while(opt == '1');
if(opt == '2')
{
clrscr();
textbackground(BLUE);
textcolor(YELLOW + BLINK);
printf("INSTRUCTIONS :-");
printf("\n\n\n");
printf("1. The objective of this game is to destroy the target by dropping a bomb on it.\n2. The player needs to drop the bomb from an aeroplane.\n\n3. Press any key to start flying the aeroplane.\n\n4. Then again press any key to drop the bomb when you are above the target.\n\n5. The target will look like this %c.", 219);
getch();
goto menu;
}
if(opt == '3')
{
}
else
{
goto menu;
}
}
United States  Offline
    Register to Reply to This Post
Old 12-08-2006, 08:22 AM   #2
uOpt
Learning To Overclock
Senior Member
 
Posts: 108
Last Seen: 05-16-2008
iTrader: 0 / 0%
Uh, error message?

Grep for the missing symbols in header files and include the headers that have them.
United States  Offline
    Register to Reply to This Post
Old 12-08-2006, 12:40 PM   #3
dynetk
Mad Warranty Voider
dynetk's Avatar
Senior Member
 
Posts: 1,803
Last Seen: Today
Age: 30
From: Sacramento, CA
iTrader: 1 / 100%
It'll help if you post the errorlog. The thing is you're probably using Windows XP and that code was written for what looks like DOS. Most compilers these days won't come with the older dos support. You should try to check out Borlands site I think they still give Turbo C++ away for free. That may be able to get this code to compile.
United States  Offline
    Register to Reply to This Post
Old 12-08-2006, 10:10 PM   #4
CodeWeasel
Rawker Kitteh
CodeWeasel's Avatar
Moderator
 
Posts: 886
Last Seen: Today
Age: 23
From: Candy Mountain!
iTrader: 0 / 0%
gggrrrrrRRRRRRAAAWWWWRRRRR COOOOODE TAAAAGS!!111
United States  Offline
    Register to Reply to This Post
Old 12-09-2006, 09:26 PM   #5
Fourth
Dimension, The
Fourth's Avatar
Senior Member
 
Posts: 2,375
Last Seen: Yesterday
Age: 24
From: Buffalo, NY
iTrader: 1 / 100%
Quote:
Originally Posted by CodeWeasel View Post
gggrrrrrRRRRRRAAAWWWWRRRRR COOOOODE TAAAAGS!!111
keep trying. maybe some day.


I looked at the first few lines... then it became unreadable.
United States  Offline
    Register to Reply to This Post
Sponsored Links:
Please Register to Post a Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile/Decompile snak3y3z1001 Programming, DBMS, HTML, Web Related 2 05-05-2004 03:14 PM
Can't compile ANYTHING! HELP!! Zanneth Linux, BSD, Alternative OS's 7 04-21-2004 07:25 PM
How_To Compile 2.6.????????? Sound-Mind Linux, BSD, Alternative OS's 5 12-31-2003 12:26 PM
How fast can you compile your kernel? ronnie0738 Linux, BSD, Alternative OS's 5 12-15-2002 05:48 PM
Kernel Compile Issues Grey Linux, BSD, Alternative OS's 1 04-22-2002 11:31 AM

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -6. The time now is 03:26 PM.

Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Powered by vBulletin
Copyright ©2000 - 2010, EXTREME Overclocking