View Single Post
Old Jan 8th, 2006, 12:37 PM   #4
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Quote:
Originally Posted by coldDeath
This is no hep whatsoever, but nevermind :-) :
if (two player cells are in a row)
{
   block_a_cell();
}
else
{
  if(two player cells are in a row && there is a space to go in the next cell)
  {
     move_in_a_cell();
   }
   else if (one player cell is on its own && there are two spaces)
   {
        move_in_a_cell();
   }
   else if (there are three empty spaces)
   {
        move_in_a_cell();
   }
   else
   {
      move_in_a_random_cell();
   }
}

Obviously thats far from perfect, and its not completed or even in VB. And there are much better ways than that, but thats just my idea :-)
ColdDeath, you might want to note that your first if expression tests for something that if's inside of the else statement test for also -- making it impossible for the 1st 2nd level if inside of that else to be called.
__________________

tempest is offline   Reply With Quote