#!/usr/bin/ruby require "aitask.rb" class TaskRandMove < ElAITask def desire() return 1 # We're always willing to send a random move! end def execute() possible_moves = [" . ", "h ", "j ", "k ", "l ", "y ", "u ", "b ", "n ", "H ", "J ", "K ", "L ", "Y ", "U ", "B ", "N ", # "Fh ", "Fj ", "Fk ", "Fl ", # "Fh ", "Fj ", "Fk ", "Fl ", # "Fy ", "Fu ", "Fb ", "Fn ", # "Fy ", "Fu ", "Fb ", "Fn ", "_>. > ", "_#. ", "_#. ", "_#. ", "_#. ", "_#. ", "_|. ", "_-. "] next_move = possible_moves[rand(possible_moves.length)] $game.send(next_move) end end if __FILE__ == $0 require "../utils/assert.rb" print "unit test succeeded\n" end