play_epic {rwarrior} | R Documentation |
Play through an epic quest of a tower
Description
Write a single AI function to play through each level of the specified tower. Refine your AI in order to achieve an overall S rank.
Usage
play_epic(
ai,
tower = c("beginner"),
warrior_name = "Fisher",
level_output = TRUE,
sleep = getOption("rwarrior.sleep", ifelse(interactive(), 0.6, 0))
)
Arguments
ai |
AI function to control your warrior. |
tower |
Tower to attempt. |
warrior_name |
Name of your warrior, for flavor. |
level_output |
A logical denoting whether to give individual level progress. |
sleep |
Time between text updates. Set to "prompt" to only progress when pressing the return key. |
Value
A tibble if successful, or otherwise FALSE.
A tibble giving the scores for each level passed.
Examples
AI <- function(warrior, memory) {
if(is.null(memory)) {
# set memory initial values here
}
# Modify the following section to be able to complete the tower
warrior$walk()
memory
}
play_epic(AI, tower = "beginner", warrior_name = "Euler")
[Package rwarrior version 0.4.1 Index]