Page 1 of 1
guys, need help with a c++ program
Posted: Tue Dec 11, 2001 11:33 pm
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)
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?
i kinda have the algorithum down, but it seems kinda long...
Posted: Wed Dec 12, 2001 4:35 am
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!
Posted: Thu Dec 13, 2001 8:31 pm
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
Posted: Thu Dec 13, 2001 8:55 pm
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
