Skip to content

Instantly share code, notes, and snippets.

@danielcristofani
danielcristofani / sqrt.rui
Created July 18, 2020 02:42
Compute square roots. (Slow for large numbers.)
r *7
=0 +3 . -7 *7 . . . . . . *4 -1 -7 +9 +8 +8 :2
-8 . *8 ~ . . -0 =1 ~ . . -9 w +10 -7 . *5 -8 *6 :2
. :7
=100 *7 !
=10 *8 !
=7:7
=8:8
=9:9
. -0 *11 !
+6 +7 +9
+8 -7 *11 -9 *12 -8 $ *8 . -6 *7 *6
=0 +4 -7 *7 . . . . *13 -7 +10 :3
-9 *9 ~ . . -0 =7 . -6 *6 *7 +5 -7 *7 . . . . -0 +14 -7 . *7 :2
-9 *9 ~ . . -0 . +14 -7 . *7 . -10 w -7 *11 -6 *15 =10 $ :3
=6:6
=7:7
=8:8
=9:9
=10:10
@danielcristofani
danielcristofani / mrm_rui.c
Last active July 1, 2020 11:13
This program translates Minsky register machine programs to Rui programs.
/* mrm_rui.c -- translate Minsky register machine to Rui
Daniel Cristofani
6/2020 */
/* This program translates register machine programs, as described in Marvin
Minsky's 1967 book _Computation: Finite and Infinite Machines_, into Rui
programs as described at https://esolangs.org/wiki/Rui, thus proving Rui
to be Turing-complete.
Minsky's book gives several varieties of register machine. This program