Floyd's triangle: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: added syntax colouring, marked p2js compatible)
m (→‎{{header|R}}: Syntax highlighting.)
Line 5,070: Line 5,070:
=={{header|R}}==
=={{header|R}}==
If it weren't for the printing requirements, we could do this in one line.
If it weren't for the printing requirements, we could do this in one line.
<lang R>Floyd <- function(n)
<lang rsplus>Floyd <- function(n)
{
{
#The first argument of the seq call is a well-known formula for triangle numbers.
#The first argument of the seq call is a well-known formula for triangle numbers.