Fungify

Fungify is a simple Befunge utility I wrote in Haskell: it takes numeric command line arguments and outputs Befunge (actually Unefunge, since it’s all one-dimensional) code for pushing that number on the stack.

It depends on the Unix factor program for swift number factorization.

Description

In addition to numbers, Fungify also accepts a couple of mode-changing arguments.

All of rpn, funge, and dc describe the output format: reverse Polish notation, (Une)Funge, and the language of the dc calculator program. Prefix them with + to request that format in addition to, instead of in place of, the previous setting.

The base number set may be restricted and widened with ascii, latin1, hex, and dec. For Befunge–93 compatible output, use dec. The default is ascii. Once again, they may be prefixed with +.

By default, the best result from the different number sets will be printed: if you want all of them, pass the each argument. To switch back to the previous mode, use best.

Example

$ fungify each dec +hex +latin1 dc 123456
3 8 8 3 2 5 8 d * * * + * * *
6 4 8 3 10 8 d * * + * * *
192 3 10 64 * + *

Download

Navigation:

Please use this permalink when linking to this page.

This page is part of the personal web site of Matti Niemenmaa (contact).