guys, need help with a c++ program

Kick Back and Relax in the Cheers! Forum. Thoughts on life or want advice or thoughts from other pca members. Or just plain "chill". Originator of da Babe threads.
Post Reply
User avatar
FuNPoLiCe001
Posts: 987
Joined: Wed Nov 22, 2000 4:57 pm
Location: T dot O dot
Contact:

guys, need help with a c++ program

Post by FuNPoLiCe001 »

turd, i got alot of work piling up that's due next week, and in my self-taughtish computers course (self taught because teacher doesnt teach anything, and gives us assignments that i have to figure out by playing with the code since we dont have books) :o

i have to do this program The Skyline Problem

in visual c ++ (mfc styles)

i dont really know how to do the graphics yet...i can do some basic stuff cuz i've been playing around with the code for about an hour now (i m writing another program where u draw a circle through 3 points, easy, at least i could solve that mathematically in 2 seconds)

can u guys help me figure this skyline thing out? :D

i kinda have the algorithum down, but it seems kinda long...
Let Cam, take care of your breasts
User avatar
Phjorg
Golden Member
Posts: 577
Joined: Fri Nov 24, 2000 11:24 am
Location: Edmonton

Post by Phjorg »

Just a quick rundown from 10 min of looking at this problem. From what I see here, you will need 2 main functions. one for finding the output. The second for drawing the output. The drawing part I can't really help ya with, I never took any kind of graphic vector output programming. but as for the finding of the output function, it looks like it should be a simple recursive structure to find the answer. I quickly played with it in my head and it looks like it should work. Shouldn't be more than 4 function and no more than a page of code... I wish I still had my compliler installed, this assignment looks interesting. I'll do some work on it sometime and see if i can create something from it!
<FONT COLOR="#888888">I AM</FONT> Canadian!!
bentwookie450
Genuine Member
Posts: 20
Joined: Tue Jun 26, 2001 8:11 pm

Post by bentwookie450 »

For the graphics part I think I can help you out. In my computer science course our teacher gave us this program with all sorta of graphics things in it, and the code to make it. If you want, send me an email and ill send you the code, it's helped me a lot when i've had to do graphics. Shoot me an email. Bentwookie450@dslextreme.com
User avatar
FuNPoLiCe001
Posts: 987
Joined: Wed Nov 22, 2000 4:57 pm
Location: T dot O dot
Contact:

Post by FuNPoLiCe001 »

okay, this is what i have so far

this is just the problem solving part, i havent started on the graphics yet

i've got an array/vector that's say...10000 long, and each unit basically represents an X coordinate

So it reads the input, and lets say the input is 1 9 4

then in the vector [1], it'll store the height 9, and do that until 4

so once we've read through all the input, we'll have a height for every point, and we can then output the resultant

problem i m running into is if there's a dropoff between points, then it wont pick it up

so should i add another array to store that, or is there a better way?

Nick :)
Let Cam, take care of your breasts
Post Reply