Jump to content

Hofstadter Figure-Figure sequences: Difference between revisions

m
→‎{{header|R}}: Syntax highlighting.
(Add CLU)
m (→‎{{header|R}}: Syntax highlighting.)
Line 2,397:
=={{header|R}}==
Global variables aren't idiomatic R, but this is otherwise an ideal task for the language. Comments aside, this is easily one of the shortest solutions on this page. This is mostly due to how R treats most things as a vector. For example, rValues starts out as the number 1, but repeatedly has new values appended to it without much ceremony.
<lang Rrsplus>rValues <- 1
sValues <- 2
ffr <- function(n)
331

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.