MPL Bytecode Compiler Code
Micro Programming Language - A Portable Language for Micro Computers
Status: Beta
Brought to you by:
buzzphp
//
// The Towers Of Hanoi
// BCPL
// Copyright (C) 1998 Amit Singh. All Rights Reserved.
// http://hanoi.kernelthread.com
//
// Tested under Martin Richards' BCPL over INTCODE compiler kit
//
// Converted to MPL by Derek John Evans
//
+libhdr
moveit(f,t) writef("move %n --> %n*n",f,t)
hanoi(n,t,f,u) n ? [
hanoi(n-1,u,f,t); moveit(f,t); hanoi(n-1,t,u,f)
]
.() hanoi(5, 3, 1, 2)