
-----------------------------------
AbyssISR
Sat Jan 06, 2007 4:09 am

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 :
http://img409.imageshack.us/img409/6945/untitledqv8.jpg

and that is what i have done so far ::
http://img462.imageshack.us/img462/5163/programcxy7.jpg

and that is the compilation errors i'm getting::

http://img462.imageshack.us/img462/2131/errorcqc3.jpg


any comment will be appreciated =)

Oren .

-----------------------------------
AbyssISR
Sat Jan 06, 2007 4:12 am


-----------------------------------
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
Sat Jan 06, 2007 4:25 am


-----------------------------------
Welcome to compsci.ca. I find it awesome that there are people from countries other than Canada visiting this forum! :)

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
Sat Jan 06, 2007 4:49 am


-----------------------------------
Welcome to compsci.ca. I find it awesome that there are people from countries other than Canada visiting this forum! :)

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 :)
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 :)

-----------------------------------
AbyssISR
Sat Jan 06, 2007 5:03 am


-----------------------------------
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
Sat Jan 06, 2007 9:28 am


-----------------------------------
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:

-----------------------------------
AbyssISR
Sat Jan 06, 2007 2:09 pm


-----------------------------------
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 -***** :P

-----------------------------------
wtd
Sat Jan 06, 2007 2:36 pm


-----------------------------------
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.

-----------------------------------
AbyssISR
Sat Jan 06, 2007 2:43 pm


-----------------------------------
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
Sat Jan 06, 2007 4:54 pm


-----------------------------------
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
Tue Jan 09, 2007 10:35 am

Re: First Experience with C Graphics..
-----------------------------------
your saying each compiler has different graphics commands?

-----------------------------------
Clayton
Tue Jan 09, 2007 4:47 pm

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 [url=http://mingw.org/download.shtml]MinGW there is a guide in the [C++ Tutorials] forum for what to do once you have MinGW installed.
