|
An obvious way is to write a system where it chooses moves randomly or semi randomly ( prefer the middle, then prefer the corners, etc, or whatever you think ) and remembers which moves lead to it winning. Obviously, some basic 'finish the row if I can win this turn' code also makes sense to have.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I dont think you will need much in the line of AI. you could simply calculate all available moves and assign a weight to each move and choose the best one. You could even use some kind of probability to "see ahead" to try to guess what the opponents best moves may be given a certain move.
|
|
|
|
|
there're only 9! (363k) potential games. Brute force is a viable option.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Agreed! Not very elegant but certainly viable.
|
|
|
|
|
I got to the same point a couple of years ago.
As already stated, brute force (check every move possible) is viable in TTT as the number of moves is quite small.
You might also like to read up on AI algo's like AlphaBeta - there is LOADS of reading online about AI.
My head got a bit swallowed up by it all and thats why I never got any further with my TTT game. But I did learn a hell of alot anyway.
|
|
|
|
|
I want to fix the location of form in my application that user could not change its location.
reply soon
|
|
|
|
|
Will the form be maximised ? If not, the best you can do is catch the moving event and move it back.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Or you can make form without border and users won't be able to move it
|
|
|
|
|
I want to create a spooler service (windows Service) which spools the job (which has to executed in time) in message queue.
What will happen if the system crash occurs or the system is restarted.
Is it possible to recover and restart it?
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
you can set the start up type to automatic, you will have to program the recovery yourself because if it crashes in the middle of some work, that work will be lost.
Regards
Shajeel
|
|
|
|
|
|
Thank you very much for you both. I will try the link and I will get back to you if more clarification is necessary.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
I have combobox column in DataGridView.
Up and down error keys should be used to navigate previous and next row in
grid.
For this I override them in ProcessCmdKey() event.
When combobox dropdown menu is open arrow arrow keys should move to previous
and next item in
dropdown menu instead of moving betveen rows.
How to check that combobox dropdown menu is open in ProcessCmdKey() ?
DataGridView ProcessCmdKey() method:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {<br />
<br />
const int WM_SYSKEYDOWN = 0x104;<br />
<br />
if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN)) {<br />
switch (keyData) {<br />
case Keys.Down:<br />
if (this.CurrentCell is DataGridViewComboBoxCell) {<br />
CurrentCell = Rows[CurrentCell.RowIndex + <br />
1].Cells[CurrentCell.ColumnIndex];<br />
return true;<br />
}<br />
break;<br />
<br />
case Keys.Up:<br />
if (this.CurrentCell is DataGridViewComboBoxCell) {<br />
CurrentCell = Rows[CurrentCell.RowIndex - <br />
1].Cells[CurrentCell.ColumnIndex];<br />
return true;<br />
}<br />
break;<br />
}<br />
return base.ProcessCmdKey(ref msg, keyData);<br />
}
Andrus
|
|
|
|
|
Can any one pls give me the answers for the following questions.
1) diff b/w for and for each loop??
2) wat is Lock in c#?
3) diff b/w abstract class and interface ?
4) when do we go for abstract class and interface class?
5) diff b/w visual studio 2003 and 2005 ?sql 2000 and 2005?
6) Use of constructor.when and at wat suitation we go for constructor.
I dont want to browse sites and get answers .as v dont cant conclude 4m it.
Thanks in Advance
Bino Varghese
-- modified at 7:33 Friday 1st June, 2007
|
|
|
|
|
Without dwelling on how rude the below statement is,
BINO VARGHESE wrote: I dont want to browse sites and get answers .as v dont cant conclude 4m it.
So how can you conclude from what somebody posts on a forum?
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Hey viki come on man take it in the rite spirit....
its all about experience.I personally blve here in Code project all r experienced enough to give me the right answer.Nthg other than tat.
If I was wrong I'm sorry dude....
|
|
|
|
|
BINO VARGHESE wrote: its all about experience.I personally blve here in Code project all r experienced enough to give me the right answer
That's good to know. But in an interview situation the interviewer wants to know about YOUR experience. Not the experience of skilled people that volunteer on internet forums.
|
|
|
|
|
Colin Angus Mackay wrote: in an interview situation the interviewer wants to know about YOUR experience. Not the experience of skilled people that volunteer on internet forums
Well said
|
|
|
|
|
|
Did you get asked these ? What do you think the answers are ? These are very entry level questions, I have to say.
BINO VARGHESE wrote: I dont want to browse sites and get answers
In that case, you'll never be a programmer. Being able to do research is a vital skill
BINO VARGHESE wrote: as v dont cant conclude 4m it.
I have no idea what this means
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes Im in entry level only ...I'm jst 6 months experienced..
|
|
|
|
|
6 months working with these technologies and you can't answer these very simple questions?
|
|
|
|
|
What sort of experience ? Have you been hacking away for fun ? Have you done a course ? Have you bought any books ?
Any entry level book will give you answers to these questions, and as others have said, an interview is designed to seperate the people who got a bit of info off the web from those who truly understand the answers. The questions you've asked are sufficiently base level that if you don't *understand* the answers, no-one is going to hire you.
Don't be discouraged by the response you've got, if you do some reading and come back to asking questions when you're able to do some of your own research and grasp some basic concepts, we'd love to help you. We're helping you now, it's just not in the way you'd hoped. That's what were here for.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
sorry Christian I understood my mistake.I take it in the right way which will lead me in the correct path and master C#.
No not discouraged by the responses .TO be honest yes,was upset intially ,after some good advices I understood that its my mistake.Sorry again.
Thanks again
|
|
|
|
|
To be honest, I'm self taught, and when I started ( in C++ ), I found some forums on USENET ( showing my age here ) and proceeded to ask a ton of questions, and get a similar response. I hope you respond as I did, which was to take the advice and work hard to become someone who was able to ask intelligent questions, and give intelligent answers. I got my first job in C++ six months after I started learning, mostly due to the help I got once I'd got myself to a level of asking for it.
Good luck.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|