Anonymous user
Towers of Hanoi: Difference between revisions
→{{header|Python}}: VPython: examples
(→{{header|Python}}: VPython: examples) |
|||
Line 1,984:
=={{header|Python}}==
===recursive===
<lang python>def hanoi(ndisks, startPeg=1, endPeg=3):
if ndisks:
Line 1,991 ⟶ 1,992:
hanoi(ndisks=4)</lang>
==={{libheader|VPython}}===
There is a 3D hanoi-game in the examples that come with VPython,
and at [https://github.com/vpython/visual/blob/master/examples/hanoi.py github].
=={{header|R}}==
|