Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 First Experience with C Graphics..
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
AbyssISR




PostPosted: Sat Jan 06, 2007 4:09 am   Post subject: First Experience with C Graphics..

Hi Canada falks =]
My friend addressed me here, Told me this is a great place with smart ppl =p
i'm from Israel btw.. =p
anyway!~
im using BorlandC++ Complier
my school gave me the first C project which is 20% of my overall grade in C class, and I sure can use some help ..
alright, i'm suppose to create a "Guess the hidden number" game .
my teacher told us to divide the gameplay screen from the 640*480 to 640*400 and 640*80, which means that the bottom alone .
and in the big screen i'm suppose to print numbers who are not the number the random function chose for me..
in 2 for loops, one after the other..
and inside that im suppose to do a while loop,
with the condition of : while (!random(x)==number_choosen && !setcolor==color)
i'm sure i made some mistakes in that while loop but my intention is more important than the syntax..
the second condition that i wrote is written for the color of the number i am printing on the screen randomly,
is not in the same color as the background color, because then obviously the user won't be able to see the numbers..
i hope you catch my drift..
but for any case i draw a picture in Paint, here :
[not because i think ur dumb or something, in case my english isn't good enough for you to understand.. ]
Posted Image, might have been reduced in size. Click Image to view fullscreen.

and that is what i have done so far ::
Posted Image, might have been reduced in size. Click Image to view fullscreen.

and that is the compilation errors i'm getting::

Posted Image, might have been reduced in size. Click Image to view fullscreen.


any comment will be appreciated =)

Oren .
Sponsor
Sponsor
Sponsor
sponsor
AbyssISR




PostPosted: Sat Jan 06, 2007 4:12 am   Post subject: (No subject)

in the picture i posted about the dimentions of the game,
i wrote 480 and 80 under it, its suppose to be 400 instead of 480 ..
sowie..
and sorry for posting my topic again,
i didnt find an "edit" button ..
ericfourfour




PostPosted: Sat Jan 06, 2007 4:25 am   Post subject: (No subject)

Welcome to compsci.ca. I find it awesome that there are people from countries other than Canada visiting this forum! Smile

There is no edit button in the help forums. It was being abused so it was removed.

In this forum you can use the code tags to display your code instead of going through the hassle of taking screenshots.

You should also be using something other than notepad to edit your code. There are text editors with syntax highlighting that you can pay for or there are free ones like Textpad (which I fully recommend).

Anyway, your English was fine. I understood it without the image.
AbyssISR




PostPosted: Sat Jan 06, 2007 4:49 am   Post subject: (No subject)

ericfourfour wrote:
Welcome to compsci.ca. I find it awesome that there are people from countries other than Canada visiting this forum! Smile

There is no edit button in the help forums. It was being abused so it was removed.

In this forum you can use the code tags to display your code instead of going through the hassle of taking screenshots.

You should also be using something other than notepad to edit your code. There are text editors with syntax highlighting that you can pay for or there are free ones like Textpad (which I fully recommend).

Anyway, your English was fine. I understood it without the image.


thank you Smile
very nice to meet you mate!
i have yet to hear anything bad about canada, and ppl from there,
only good things, im glad to know its true =]
nice ppl indeed .

and btw, i read a few topics back, and just to clearify,
i am NOT asking you to write my project lol
i saw a dude ordering you to write his project that was halirious ^^;
I'm just asking for pointers and help with my current code..
I'm not that good in C & Pascal, my grades are between 50 to 75 more or less.
+ the teacher wants us to do it all alone, she only gave us a few guide lines, which doesn't really help me when i don't actually know to execute them ..

and thank you for the reply Smile
AbyssISR




PostPosted: Sat Jan 06, 2007 5:03 am   Post subject: (No subject)

oh damn
i just checked my notebook and the bar command is suppose to be before the setfillstyle X_X
fixed that,
does anyone know how do i make the screen the way i have shown in the picture ?
im stuck =[
ownageprince




PostPosted: Sat Jan 06, 2007 9:28 am   Post subject: (No subject)

hey the randomize(); gives you an error because you didn't include the
random.h
in our school we get an lvp folder with those other libs
i can give you the code for the random.h lib here:



RANDOM.H
 Description:
it has two functions and use the time.h will should be in the compiler.

Download
 Filename:  RANDOM.H
 Filesize:  723 Bytes
 Downloaded:  124 Time(s)

AbyssISR




PostPosted: Sat Jan 06, 2007 2:09 pm   Post subject: (No subject)

ownageprince wrote:
hey the randomize(); gives you an error because you didn't include the
random.h
in our school we get an lvp folder with those other libs
i can give you the code for the random.h lib here:


i did what u said and the complier said he is unable to open that library..
im using borland C++ complier if that matters anything..
its still not working
and ill be happy to get a list of all the #includes that there is..
i cant believe my teacher didnt told us that we will need extra libraries!
that -***** Razz
wtd




PostPosted: Sat Jan 06, 2007 2:36 pm   Post subject: (No subject)

You may find help somewhat less forthcoming than in other threads, as most of us use GCC, and try to stick to standard C or C++ whenever possible.
Sponsor
Sponsor
Sponsor
sponsor
AbyssISR




PostPosted: Sat Jan 06, 2007 2:43 pm   Post subject: (No subject)

wtd wrote:
You may find help somewhat less forthcoming than in other threads, as most of us use GCC, and try to stick to standard C or C++ whenever possible.


i didnt understood what u wrote there pal :S
md




PostPosted: Sat Jan 06, 2007 4:54 pm   Post subject: (No subject)

Those of us who usually help answer C/C++ questions use the Gnu Compiler Collection (gcc) and push for standards compliance. The Borland C++ compiler is extremely old, not at all standards compliant and IIRC limited to windows. Hence we really can't provide as much help as we would otherwise, mostly because we are not familiar with the compiler.
AbyssISR




PostPosted: Tue Jan 09, 2007 10:35 am   Post subject: Re: First Experience with C Graphics..

your saying each compiler has different graphics commands?
Clayton




PostPosted: Tue Jan 09, 2007 4:47 pm   Post subject: Re: First Experience with C Graphics..

no, when a compiler was created, it was created to meet the standards of that time, as well as the code of that time. An older compiler will not know what some things are, and will fight with you saying that something is wrong, even though it is in fact right. I would suggest downloading and installing MinGW there is a guide in the [C++ Tutorials] forum for what to do once you have MinGW installed.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: