view src/ploki/examples/hanoi.pk @ 11339:a3b6a53b86d8

<shachaf> le//rn_append dowg//One who uses many dowgs is known as a dowager.
author HackBot
date Sat, 03 Feb 2018 02:52:09 +0000
parents ac0403686959
children
line wrap: on
line source

#!../ploki
IF \ARG < 2
	WUNT "Usage: \V\ARG:0 NUMBER\n"
	END -1
FI
LET a "a"
LET b "b"
LET c "c"
move \ARG:1
WUNT "\n"
END
FOR move IF \@ > 0
		LEET ax a
		LEET bx b
		LEET cx c
		LET b cx
		LET c bx
		move \@ - 1
		WUNT (ax_bx_" ")
		LET a cx
		LET b bx
		LET c ax
		move \@ - 1
	FI
KTHX