package org.skife.nano.action; import java.util.List, Random; class Wombat { prey = [] random animal = "" message = "" Wombat(Random random) { this.random = random } goWest() { if (random.nextBoolean()) { prey << "buffalo" } return "hunting" } goEast() { if (random.nextBoolean()) { prey << "rabbit" } return "hunting" } attack() { if (random.nextBoolean() && random.nextBoolean()) { message = "ROAR! Wombat Attak! ${animal} was yummy!" prey = [] return "hunting" } else { message = "ROAR! Wombat Attack! ... But ${animal} got away. Sad wombat." return "hunting" } } }