/** Towers of Hanoi
Towers of Hanoi : move N disks (N=4 in this example) from peg1 to peg2 with the help of auxiliary peg3. Constraints : move only 1 disk at a time and a larger disk can never be put on top of a smaller disk.

:-object hanoi : [bcilib].

	var hanoiURL = 'dlp.cs.vu.nl/~ctv/dlptest/hanoi.wrl'.

	main :-
		setDescription('Towers of Hanoi'),
		disks(4, peg1,peg2,peg3).

	disks(1, P1,P2,_) :-
		disk_move(1, P1,P2).
	disks(N, P1,P2,P3) :-
		N1 is N - 1,
		disks(N1, P1,P3,P2),
		disk_move(N, P1,P2),
		disks(N1, P3,P2,P1).

	init_vrml(URL, Delay) :-

	disk_move(DiskN, PegFrom, PegTo) :-
		getSFVec3f(PegTo, translation, DestX, _, _),
		format_to_atom(DiskName, 'disk~w', [DiskN]),
		format_to_atom(Move, '~w to ~w',  [PegFrom, PegTo]),
		setMFString(bboard, text, [DiskName, 'from', Move]),
		getSFVec3f(DiskName, translation,_DiskX, DiskY, DiskZ),
		setSFVec3f(DiskName, translation, DestX, DiskY, DiskZ),

:-end_object hanoi.