My Frink page
Frink is a Java based general programming language (written by Alan
Eliasen) with the added feature that it supports conversion between a huge number of different units
(eg length, times, mass, etc, etc).
Here's the description from Frink's site:
Frink is a practical calculating tool and programming language designed to make physical calculations simple, to help ensure that answers come out right, and to make a tool that's really useful in the real world. It tracks units of measure (feet, meters, kilograms, watts, etc.) through all calculations, allowing you to mix units of measure transparently, and helps you easily verify that your answers make sense. It also contains a large data file of physical quantities, freeing you from having to look them up, and freeing you to make effortless calculations without getting bogged down in the mechanics.
Perhaps you'll get the best idea of what Frink can do if you skip down to the Sample Calculations further on this document. Come back up to the top when you're done.
It is available both for Linux, MacOS, Windows, and many devices, e.g. Android.
Other pages of interest:
My Frink programs
Here is some of my Frink programs. Many programs are from Project Euler (and perhaps later on from Rosetta Code). Note that these programs don't show the unit conversion feature much; it's more to explore the general programming features in Frink.
Some of the programs below uses my utility file HakankUtils.frink which includes at least the following functions:
-
reduce[array, f]
: reduce for all elements in array for function f
-
zip[array1,array2]
: collect each elements from array1 and array2 into one array (reverse to unzip)
-
unzip[array]
: separates array of form [[i0,j0],[i1,j1],,,[in-11,jn-1]] into [[i0,i1,...in-1],[j0,j2,..jn-1]] (reverse to zip)
-
concordance[file]
: concordance of text in file
-
alldifferent[array]
: is all elements in array distinct
-
english[n]
: the spelled out English name of number n
-
fib[n]
: n'th Fibonacci number
-
isPrime2[n]
: is n a prime (where 1 is not considered a prime)
-
argMax[array]
: get the index of the largest number(s) in array
-
argMin[array]
: get the index of the smallest number(s) in array
-
even[n]
: is n even
-
odd[n]
: is n odd
-
partition[array, f]
: partition elements into partitions according to a function f
-
table[array]
: frequency table of the elements in array
-
timeit[f]>
, timeit[f, arg]
, and timeit[f,arg1,arg2]
: timing of function (0, 1, and 2 argument versions)
-
romanDecode[num]
: Decode Roman numeral tod ecimal
-
romanEncode[num]
: Encode decimal num to Roman numeral
-
rot13[string]
: rot13 of a string
-
rotN[string,n,alpha="a..z"]
: generatlized version of rot13
-
rotX[string,alpha]
: "invertible" rotN for a specific alphabet
-
soundex[string,n]
: Soundex of a string of length n
-
hailstone[n]
, hailstoneSeq[n]
: Hailstone sequence (Collatz sequence)
So, here are the Frink programs:
Back to my homepage.
Created by Hakan Kjellerstrand (hakank@bonetmail.com)