Примеры программ на языке QBASIC

DECLARE SUB MoveAll (k%, from$, to$, tmp$)
DECLARE SUB MoveOne (from$, to$)
CLS
INPUT "Введите количество дисков ", k%
MoveAll k%, "A", "C", "B"
END

SUB MoveAll (k%, from$, to$, tmp$)
  IF k% = 0 THEN EXIT SUB
  MoveAll k% - 1, from$, tmp$, to$
  MoveOne from$, to$
  MoveAll k% - 1, tmp$, to$, from$
END SUB

SUB MoveOne (from$, to$) STATIC
  m% = m% + 1
  PRINT USING "#### : &--> & "; m%; from$; to$
END SUB