Fixed defensive and offensive algorithms

-- Made major bug fixes for the level algorithm
-- Added defensive mechanism for decision making
-- Added offensive mechanism for decision making
-- Added losing condition detection
-- Added win condition detection
-- Added risk taking if no other moves are possible
-- Established hiearchy for decision making.