powered by
Attempt inbuilt levels of R Warrior.
play_warrior( ai, level = 1, tower = c("beginner"), warrior_name = "Fisher", sleep = getOption("rwarrior.sleep", ifelse(interactive(), 0.6, 0)), practice = FALSE )
A tibble if successful, FALSE if unsuccessful, and NA if the AI function caused an error or no action was called.
AI function to control your warrior.
Level number.
Tower the level comes from.
Name of your warrior, for flavor.
Time between text updates in seconds. Set to "prompt" to only progress when pressing the return key.
If TRUE, any functions available for that tower may be used.
AI <- function(warrior, memory) { if(is.null(memory)) { # set memory initial values here } # insert AI code here memory } play_warrior(AI, level = 1)
Run the code above in your browser using DataLab