*edited everything clean so I can post my new problem hehe.
*edited everything clean so I can post my new problem hehe.
Last edited by ZakkWylde969; 06-16-2003 at 07:44 PM.
"When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."
>>y=ROWS//2;
You have an extra slash there.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Thanks.
"When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."
And here is my Compile error. the problem is is that it is saying there is a problem with text that isnt there.Code:#include <stdio.h> #include <stdlib.h> #include <time.h> #include <dos.h> #define FACE 0x08 //Face Character number #define BLANKSPACE 0x08 //Backspace charactor #define BLANK 0x20 //Blacnk character number #define LOOP 100 //number of faces to dispay #define PAUSE 150000 //pause time (0-16,000,000) #define VIDEO 0x10 //video interrupt #define COLS 80 //screen width #define ROWS 25 //Screen rows void cls(void); void locate(int col , int row); int rnd(int range); void main () { int t,x,y; unsigned long p; //p=pause loop cls(); //clear the screen seedrnd(); //set randomizer // start at the center of the screen x=COLS/2; //half screen width y=ROWS/2; //half screen hight //move the drunk LOOP number of times for (t=0;t<LOOP;t++) { locate(x.y); //move cursor putchar(FACE); //be happy for(p=0;p<PAUSE;p++); //pause /* SCript above moves the drunk dude RYCHER all around. it will be funny */ x+=(rnd(3)-1); //new random x y+=(rnd(3)-1); //new random y /*These next things make sure RYCHER doesnt float off the screen on accident */ if(x<1) x=80; //wrap left if(x>80) x=1; //wrap right if(x<1) y=25; //wrap to the bottom if(x>25) y=1; //wrap top /*This part next will make him appear back in the middle */ putchar(BACKSPACE); //back up putchar(BLANK); //and erace the drunk } } void cls(void) { union REDS reds; regs.h.ah=0x06; //call function 6, scroll window regs.h.al=0.x00; //clear screen regs.h.bh=0x07; //make screen blank color regs.h.ch=0x00; //upper left row regs.h.cl=0x00; //upper left column regs.h.dh=ROWS-1; //lower right roow regs.h.dl=cols-1; //lower right column int86(VIDEO,®s,®s); locate(0,0); //Home the cursor } void locate(int col,int row) { union REGS regs; regs.h.ah=0x02; //video function 2, move the cursor regs.h.bh=0x00; //videos screen which is always 0 regs.h.dh=row; //cursors column position regs.h.dl=col: //cursors row position int86(VIDEO,®s,®s); } int rnd(int range) { int r; r=rand()%range; //split up a random number } void seedrnd(void) { srand((unsigned)time(NULL); }
Why is it missing the dos.h file? And why am I having wrong code in blank space. Man this stuff is annoying.Code:Miracle C Compiler (r3.2), written by bts. line 4: #include dos.h ignored--file not found. Compiling c:\documents and settings\justin\desktop\compiled files\drunkdude.c main c:\documents and settings\justin\desktop\compiled files\drunkdude.c: line 36: bad . ref '{ locate(x.y)' aborting compile
"When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."
>>locate(x.y)
You should have a comma, not a period.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
thats the new compiler error.Code:unrecognised types in comparison 'for(p=0'
Im really trying not to be too much of a pain in the ass but this is really confusing me. Its talking about the pause part i presume. Ugh what a pain.
"When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."
You might run into problems using this program on OSes such as Win2k, NT, or XP (?). You *might* consider an older dos compiler since one will have the functions that you're using int86 on now, and it will have dos.h.
You can download the relic Turbo C for free, but you must register first. Look in the museum afterwards.
pause may be the problem since you also have stdlib included. Try renaming that. I'd use a delay function from time.h instead of a loop since the loop will run at different speeds depending on the speed of the user's processor.
HTH
I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P
Actually I am teaching myself over the summer and I picked up an old C book and flipped through it. (C for Dummies Vol one.) They have some sourse code in the back and I just entered it into one because it looked cool. But Ill get a different compiler too.
"When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."
>>*edited everything clean so I can post my new problem hehe.<<
Err, please don't delete posts that are relevant to the thread unless you really have to. Other people learn from your questions too, or at least, they would if they can read them
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Ok. Sorry about that I just didnt want to put too much code onto this thread and make it confusing.Originally posted by Hammer
>>*edited everything clean so I can post my new problem hehe.<<
Err, please don't delete posts that are relevant to the thread unless you really have to. Other people learn from your questions too, or at least, they would if they can read them
"When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."