Rock-paper-scissors: Difference between revisions

Content added Content deleted
mNo edit summary
m (→‎{{header|R}}: Syntax highlighting.)
Line 4,585: Line 4,585:
=={{header|R}}==
=={{header|R}}==
This milks R's vectorisation quite heavily. However, this approach doesn't generalise well to the extra credit task. In particular, the last two lines of the loop would need a lot of work to be both non-ugly and working.
This milks R's vectorisation quite heavily. However, this approach doesn't generalise well to the extra credit task. In particular, the last two lines of the loop would need a lot of work to be both non-ugly and working.
<lang R>play <- function()
<lang rsplus>play <- function()
{
{
bias <- c(r = 1, p = 1, s = 1)
bias <- c(r = 1, p = 1, s = 1)