Example Miranda scripts

This directory contains a fairly random collection of simple scripts written in Miranda. The scripts are listed in groups, with some more advanced examples towards the end. Note that the identifiers of the Miranda standard environment are always in scope.

ack.m         the ackermann function
divmodtest.m  tests properties of div and mod
fibs.m        tabulates fibonacci numbers
hanoi.m       solves the problem `towers of hanoi'
powers.m      prints a table of powers
primes.m      infinite list of prime numbers
pyths.m       generates pythagorean triangles

hamming.m prints hamming numbers queens.m all solutions to the eight queens problem queens1.m finds one solution to the eight queens problem quicksort.m Miranda definition of quicksort selflines.m curiosity - a self describing scroll of lines stack.m defines stack as an abstract data type treesort.m Miranda definition of treesort
edigits.lit.m infinite decimal expansion of the digits of `e' (literate script) rational.m package for doing arithmetic on rationals refoliate.m a tree problem (literate script) topsort.m topological sort matrix.m matrix package set.m defines set as an abstract data type kate.lit.m a Miranda literate script that is also a LaTeX source file see the LaTeX output kate.pdf [59k]
genmat.m parameterised version of matrix package just.m text formatting program mrev (executable) Miranda version of the UNIX `rev' command box (executable) program for reboxing Miranda comments box.m function definitions for `box' unify.m package for doing 1st order unification polish.m testbed for unify.m

These examples are included in the Miranda download, in a subdirectory ex of the miralib directory, say /cd <ex> in a Miranda session to find them. Alternatively you will find downloadable versions here.

Miranda home Site Meter