inst/resources/scripts/play_game.r

# Program spuRs/resources/scripts/play_game.r

play_game <- function(a, b) {
    state <- c(0, 0, 1)
    while (status(state[1], state[2]) == "unfinished") {
        # show(state)
        state <- play_point(state, a, b)
    }
    if (status(state[1], state[2]) == "player 1 win") {
        return(TRUE)
    } else {
        return(FALSE)
    }
}

Try the spuRs package in your browser

Any scripts or data that you put into this service are public.

spuRs documentation built on May 2, 2019, 12:44 p.m.