[go: up one dir, main page]

File: hanoi.txt

package info (click to toggle)
chpp 0.3.4-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,228 kB
  • ctags: 5,154
  • sloc: ansic: 30,186; cpp: 575; sh: 500; makefile: 314; yacc: 265; asm: 261; lex: 64
file content (4 lines) | stat: -rw-r--r-- 265 bytes parent folder | download | duplicates (3)
1
2
3
4
%define(move,from,to,%from -> %to%'\n')\
%define(_hanoi,cnt,from,to,aux,%if(%[cnt<=1],%move(%from,%to),%<_hanoi(%[cnt-1],%from,%aux,%to)>%move(%from,%to)%<_hanoi(%[cnt-1],%aux,%to,%from)>))\
%define(hanoi,cnt,%_hanoi(%cnt,source,destination,auxilliary))\
%hanoi(5)