Click here to Skip to main content
15,797,984 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am trying to program actually colored boxes on a 4 by 4 array and assign inputs to them and then swap boxes. How can i go by doing this. i am a little bit familiar with c++
Albert Holguin 8-Jun-11 12:55pm    
what do you mean "colored boxes on a 4x4 array"?
Smithers-Jones 8-Jun-11 13:30pm    
Are you by any chance working on the same project as Martin Thwaites does? See here: :-)

The first thing to do is think how to do it in logical steps and write that down. That will make writing the code somewhat easier to visualise. It should also help you to think about the attributes that each square should have.

Do you know how to deal with Windows messages, how to paint coloured squares in a Window, how to write a basic Windows program, etc.?
Share this answer
Sergey Alexandrovich Kryukov 8-Jun-11 15:51pm    
Agree, a 5.
Sounds to me like someone's trying to cheat on a homework problem. I mean, who uses C++ to develop Windows software anyways? At least use MFC.
Share this answer
Sergey Alexandrovich Kryukov 8-Jun-11 16:05pm    
Well, many do. I voted 5 anyway. However, I would accept your idea as a recommendation to use something else; I would suggest .NET, not MFC. A can compare how awkward is MFC UI development compared to .NET. There are other good approaches. Native Windows API is good to know anyway.
Richard MacCutchan 9-Jun-11 3:26am    
There are many people who do not use MFC, all the thousands who use Visual C++ Express editions, for a start.
Sergey Alexandrovich Kryukov 12-Jun-11 18:22pm    
For sure.
Brian C Hart 12-Jun-11 23:36pm    
Whatever. I think the first part of what I said is true. This is such an elementary question it really smells of cheating attempt to me.
Brian C Hart 12-Jun-11 23:37pm    
Just assign each box (i.e., color) a number and the do the swaps per the appropriate Numerical Recipes algo. As far as Win32 application, there is plenty of boilerplate living on the net.

It's called Google.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900