|
One way might be:
int nNumbers[9][9] = {0};
...
while (1)
{
int nRow = rand() % 9;
int nCol = rand() % 9;
if (0 == nNumbers[nRow][nCol])
{
nNumbers[nRow][nCol] = 1;
break;
}
} There are several other approaches to this.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks for answering but it's not really what I'm looking for.
You see, I have a class called Number.
I create a [9][9] array of it.
It is preset with 1-9 for every line:
for (int i = 0; i < 9; i++)
{
for (int j = 0; j < 9; j++)
{
myNumbers[i][j].setNumber(j + 1);
}
}
It is suppose to return a value:
//The puzzlecell is a class too.
//The random picked number for the line is put at the current position in the PuzzleCell which stores a value and will be presented in a Label when done.
myPuzzleCell[i][j].setTheValue(myNumbers[i][tempRand1].getNumber());
All this has to have the ability to preset and reset stuffs since I have all this in a huge loop which checks if the lines are good due to the Puzzle rules, which you can find at the page I linked previously. Please check the puzzle out so you get a hint.
Notice that I cannot only set random values and wish for it to be done in a century, I also have a system where I if a Line == 45 // (1+2+3+4+5+6+7+8+9) then save that line (by setting them to permanent true).
|
|
|
|
|
can any one tell me how to display a web page using MFC? just like we do in VB making use of the web controls...
regards,
Rookie
|
|
|
|
|
One way is to create an SDI application using a view derived from CHtmlView . Then you can use the Navigate() or Navigate2() methods to display the page.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Another way is to directly use a web browser control. See this[^] link.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Nice link Ravi.. thanks.. i cant believe how fast i'm getting help with codeproject..!
vivek
|
|
|
|
|
thanks david n ravi. the link is really resourceful.
learning,
Rookie
|
|
|
|
|
i just had similar doubt.. thankz rook
vivek
|
|
|
|
|
hi ppl,
I've been looking around for a while now, and I still can't find a simple, minimum & easy to use RSA implementation (and free of course). If know of such implementation, I'd appreciate some info
I need to be able to use the implementation in a shareware app, but only for my protection scheme, i.e. internal use. Further on, MFC or any other framework should not be used (so, plain Win32 API or STL are good )
I know this is a bit too specific, but if anyone knows anything, it would be a great help
---
YOU KNOW WHAT YOU ARE BLONDIE!?!? YOU'RE JUST A SON OF A BA A A A AAAAAAAAAA!!!!!
http://sprdsoft.cmar-net.org
http://t1tan.cjb.net
|
|
|
|
|
|
There is also a version from RSA laboratories... It is much smaller and easier to use... but I've forgotten the download link
Don't try it, just do it!
|
|
|
|
|
I've been digging through RSA labs site for a loooong time, and all I could find is a bunch of docs Is there another download location for RSA stuff??
thx
---
YOU KNOW WHAT YOU ARE BLONDIE!?!? YOU'RE JUST A SON OF A BA A A A AAAAAAAAAA!!!!!
http://sprdsoft.cmar-net.org
http://t1tan.cjb.net
|
|
|
|
|
yeeeees I've tried that, I couldn't get the thing working..
Anyways, since RSA is going to be a part of anti-crack-hack-slash protection, I think it would be unwise to use crypto++ since it's a separate module..could be easily avoided & my proggy would eventually get hacked (like that's not gonna happen anyway )
But I might take a closer look whatsoever, thanx
---
YOU KNOW WHAT YOU ARE BLONDIE!?!? YOU'RE JUST A SON OF A BA A A A AAAAAAAAAA!!!!!
http://sprdsoft.cmar-net.org
http://t1tan.cjb.net
|
|
|
|
|
|
That's what I was told by my boss in my last contract, when he was looking at some of my code that used it. His view was that he wouldn't touch it with a barge pole. Given that STL is a part of Standard C++ what do you guys think of such an attitude?
Kevin
|
|
|
|
|
Kevin McFarlane wrote:
what do you guys think of such an attitude?
Ignore it and move on.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Pretty much what I did. Also, I only worked on that paticular project for two or three weeks.
Kevin
|
|
|
|
|
Well, he is the boss, right? If he is ready to pay you for the extra hours you are going to spend because you can't use the Standard Library, it's all good and well. Your time is his money, right?
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Nemanja Trifunovic wrote:
Well, he is the boss, right? If he is ready to pay you for the extra hours you are going to spend because you can't use the Standard Library, it's all good and well. Your time is his money, right?
And if they just use containers from MFC or another library instead of STL bloatware?
|
|
|
|
|
CP Visitor wrote:
And if they just use containers from MFC or another library
STL is more than just "containers", although I agree that using MFC containers is much better than raw arrays.
CP Visitor wrote:
STL bloatware
Just take some time and learn it - it is really useful, especially when enriched with Boost libraries. Although, I admit I hate its name conventions
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Kevin McFarlane wrote:
Given that STL is a part of Standard C++ what do you guys think of such an attitude?
May be, He doesn't like STL at all
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
Unfortunately, his attitude was probably formed from the poor support for the STL provided by Microsoft prior to VS.NET. We have a similar problem, in that our development up to now has used the MFC collection classes, and we really don't want to mix the two at this point.
Software Zen: delete this;
|
|
|
|
|
I found VC++ 6's STL support good enough for what I wanted to do. Maybe I'm an insufficiently advanced STL user? I view these things as tools. If the MFC collection classes do what you want then use them. But if there is functionality available in STL which is not in MFC we shouldn't be afraid to use it. Especially as STL is part of Standard C++.
Kevin
|
|
|
|
|
Kevin McFarlane wrote:
I found VC++ 6's STL support good enough for what I wanted to do.
same here.
i never understood all the complaints about VC6's STL.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|