Jump to content

Towers of Hanoi: Difference between revisions

m
→‎{{header|R}}: Tweaked output line
(→‎{{header|J}}: Add lang tags, improve readability of explicit defintion.)
m (→‎{{header|R}}: Tweaked output line)
Line 664:
<lang R>hanoimove <- function(ndisks, from, to, via) {
if ( ndisks == 1 )
print(sprintfcat("move disk from", %dfrom, "to %d", fromto, to)"\n")
else {
hanoimove(ndisks-1, from, via, to)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.