algorithm question

M

minnew

I looking to design a (graphical) program in which a known path (such as anelectrical circuit) can be interrupted by the user. That is, the user canclick the mouse anywhere on a path to "cut" it so that the path is disabled. Once the path is cut, the item connected to the path reacts (such as a light bulb going out). From a high level point of view, what would be the best code / algorithm to design such an interface?

thanks
 
V

Victor Bazarov

I looking to design a (graphical) program in which a known path (such
as an electrical circuit) can be interrupted by the user. That is,
the user can click the mouse anywhere on a path to "cut" it so that
the path is disabled. Once the path is cut, the item connected to the
path reacts (such as a light bulb going out). From a high level
point of view, what would be the best code / algorithm to design such
an interface?

Sorry, I think you're in a wrong newsgroup. Here we talk C++
*language*. If you have a C++ language problem, post it. If you don't
know where to begin, there are better places to ask about it than here.
Perhaps you should look at comp.programming or some physics
(electricity) newsgroup...

V
 
S

Stefan Ram

minnew said:
I looking to design a (graphical) program in which a known
path (such as an electrical circuit) can be interrupted by
the user. That is, the user can click the mouse anywhere on
a path to "cut" it so that the path is disabled. Once the
path is cut, the item connected to the path reacts (such as a
light bulb going out). From a high level point of view, what
would be the best code / algorithm to design such an
interface?

The standard library of C++ does not allow the UI of such a
program to be written. One needs to employ an additional GUI
framework or library. The design of the UI code then follows
the choice of a library. It cannot be designed upfront.

An algorithm always depends on the operations available. When
they are not know, one cannot write an algorithm.

Having said this, it always helps to know MVC when one wants
to write a GUI program:

http://en.wikipedia.org/wiki/Model–view–controller

, and usually one can best design a GUI application after
having gained experience with several small toy problems
in GUI programming, i.e., simple exercises.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top