cz.nipax.hippo.pexeso
Class AI_random

java.lang.Object
  extended by cz.nipax.hippo.pexeso.AI
      extended by cz.nipax.hippo.pexeso.AI_random
Direct Known Subclasses:
AI_forgetting

public class AI_random
extends AI

Implementation of totally stupid AI. Overturns two random pieces when onturn() is called. It doesn't remember which pieces are valid and calls Playground.wantturn(cz.nipax.hippo.pexeso.AI, int, int) until true is returner two times.


Field Summary
 
Fields inherited from class cz.nipax.hippo.pexeso.AI
DEBUG, m_killed, m_pg, MOVESLEEP
 
Constructor Summary
AI_random(Playground pg)
          Simple constructor - just calls super
 
Method Summary
 java.lang.String getname()
          Get name of AI
 void onturn()
          Makes two random moves.
protected  void random_move()
          Creates one valid random move.
 
Methods inherited from class cz.nipax.hippo.pexeso.AI
ivalidate, kill, println, revealed, setSleep, userinput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AI_random

public AI_random(Playground pg)
Simple constructor - just calls super

Method Detail

getname

public java.lang.String getname()
Get name of AI

Overrides:
getname in class AI
Returns:
string with name

onturn

public void onturn()
Makes two random moves.

Overrides:
onturn in class AI

random_move

protected void random_move()
Creates one valid random move. Valid means that Playground.wantturn(cz.nipax.hippo.pexeso.AI, int, int) returns true.