>> There is no child or parent, there is one class...
I know that. But the OP was talking about inheritance, so I got confused about what he meant.
>> There is no child or parent, there is one class...
I know that. But the OP was talking about inheritance, so I got confused about what he meant.
WORKS!!!Code:int minimax__depth = 0; class minimax { public: minimax(); minimax *ply; char board[20]; int depth; void look_ahead(); }; minimax::minimax(){ depth = minimax__depth; minimax__depth++; } void minimax::look_ahead() { }
But,
Prog locks up.Code:if(ply.depth == 0) Beep(2000,100); if(ply.ply[0].depth == 1) Beep(2000,100);
Also, locks up.Code:if(ply.depth == 0) Beep(2000,100); if(ply.ply[0].depth == 1) Beep(2000,100);
I'm guessing that (in the ply.ply[0].depth) it's not trying to access ply's ply. Just ply.
Renaming my lead ply to ply1 would fix that, but, not when I want to do this for an example:
ply.ply[0].ply[2].ply[1].ply[0].depth
What should I do now?
That doesn't make any sense. Since ply is a pointer,
should not compile.Code:if(ply.depth == 0) Beep(2000,100); if(ply.ply[0].depth == 1) Beep(2000,100);
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
It does though.
I learned that a compiler will see *char_var the same as char_var[infinite].
>I learned that a compiler will see *char_var the same as char_var[infinite].
...
My best code is written with the delete key.
What is the compiler you are using?
ply is a pointer. To access its member you do ply->depth. Not ply.depth.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
okay using ply.ply->depth compiles but still locks up.
Using Dev-C++.
>> I'm guessing that (in the ply.ply[0].depth) it's not trying to access ply's ply. Just ply.
This still remains true, how can I get around that?
You are not reading anyone replies. so... good luck with your program
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
>> You are not reading anyone replies. so... good luck with your program
What do you mean I'm not reading anyone replies!!!
I have tried your suggestions, and they DON'T WORK.
Okay, so ply is a POINTER. Got it.
Where does that leave me?
Actually, now that I think of it, I am probably going about this whole thing the wrong way.
Thanks for the help guys, sorry all it did was show me that I'm doing it wrong.