The Towers of Hanoi as a BCPL program.
BCPL was designed by Martin Richards in the mid-1960s while he was visiting MIT, and was used during the early 1970s for several interesting projects, among them the OS6 operating system at Oxford, and parts of the seminal Alto work at Xerox PARC.
// The Towers Of Hanoi
// Copyright (C) 1998 Amit Singh. All Rights Reserved.
// Tested under Martin Richards' BCPL over INTCODE compiler kit
LET MOVEIT(F, T) BE $(
WRITEF("move %N --> %N*N", F, T)
LET HANOI(N, T, F, U) BE $(
IF N=0 RETURN;
HANOI(N-1, U, F, T);
HANOI(N-1, T, U, F)
// Don't know if there's something like `argv' in BCPL.
// The first argument of HANOI is the number of disks,
// which is hardcoded.
LET START () BE $(1
HANOI(1, 3, 1, 2)