Skip to content

Instantly share code, notes, and snippets.

import numpy as np
from PIL import Image
def digital_reverse(n, length, base):
r = 0
for _ in range(length):
r = base*r + n % base
n /= base
return r
@x-or
x-or / quadruple_brp_rows.py
Created July 1, 2014 09:46
Quadruple Bit/Digit-Reversal Permutation (rows only)
import math
import numpy as np
from PIL import Image
np.set_printoptions(linewidth = 180, edgeitems=10, suppress = True)
def digital_reverse(n, length, base):
r = 0
for _ in range(length):
r = base*r + n % base
@x-or
x-or / mopdl_generator_modulo2.py
Created July 1, 2014 09:44
Manifestation of Permuted Diagonal Line generator (modulo 2)
#
# Manifestation of Permuted Diagonal Line generator (modulo 2)
#
import numpy as np
from PIL import Image
def digital_reverse(n, length, base):
r = 0
for _ in range(length):
@x-or
x-or / brp_rows.py
Created June 29, 2014 21:41
Bit/Digit-Reversal Permutation (rows only)
import math
import numpy as np
from PIL import Image
np.set_printoptions(linewidth = 180, edgeitems=10, suppress = True)
def digital_reverse(n, length, base):
r = 0
for _ in range(length):
r = base*r + n % base
@x-or
x-or / rug.cpp
Created October 20, 2013 15:25
Rug Cellular Automata (demo)
///// Rug Cellular Automata (demo)
///// Copyright (c) 2013, Sergey Shishmintzev
///// License: Apache/GPLv3
///// Idea: http://www.fourmilab.ch/cellab/manual/rules.html#Rug
///// Example: http://youtu.be/OQQ8zq-xjXI
///// Compiler: gcc-4.7.3 (cygwin)
///// Compile command: g++ -O3 rug.cpp -lpng
///// P.S. Sorry for my English. It isn't my mother tongue.
#include <assert.h>
@x-or
x-or / unkgen.cpp
Created October 1, 2013 15:10
Kiss My Glowing Pixel! (demo)
///// Kiss My Glowing Pixel! (demo)
///// Copyright (c) 2013, Sergey Shishmintzev
///// License: Apache/GPLv3
///// Example: http://youtu.be/xVpsqkSMgOI
///// Compiler: gcc-4.7.3 (cygwin)
///// Compile command: g++ -O3 unkgen.cpp -lpng
///// P.S. Sorry for my English. It isn't my mother tongue.
#include <assert.h>
#include <stdio.h>
@x-or
x-or / unkgen.cpp
Created September 27, 2013 08:41
Fantastic Lava
///// Fantastic Lava
///// Copyright (c) 2013, Sergey Shishmintzev
///// License: Apache/GPLv3
///// Example: http://youtu.be/OZ0wLfmWhHo
///// Compiler: gcc-4.7.3 (cygwin)
///// Compile command: g++ -O3 unkgen.cpp -lpng
///// P.S. Sorry for my English. It isn't my mother tongue.
#include <assert.h>
#include <stdio.h>
@x-or
x-or / unkgen.cpp
Created September 21, 2013 10:51
Fantastic Plasmoids
///// Fantastic Plasmoids
///// Copyright (c) 2013, Sergey Shishmintzev
///// License: Apache/GPLv3
///// Example: http://youtu.be/5dI-HHD9RsI
///// Compiler: gcc-4.7.3 (cygwin)
///// Compile command: g++ -O3 unkgen.cpp -lpng
///// P.S. Sorry for my English. It isn't my mother tongue.
#include <assert.h>
#include <stdio.h>
@x-or
x-or / unkgen.cpp
Created September 20, 2013 12:51
Pulpy Linen
///// Pulpy Linen
///// Copyright (c) 2013, Sergey Shishmintzev
///// License: Apache/GPLv3
///// Example: http://youtu.be/NWwGkdmsAQ0
///// Compiler: gcc-4.7.3 (cygwin)
///// Compile command: g++ -O3 unkgen.cpp -lpng
///// P.S. Sorry for my English. It isn't my mother tongue.
#include <assert.h>
@x-or
x-or / unkgen.cpp
Created September 19, 2013 07:46
Cellular Cubism
///// Cellular Cubism
///// Copyright (c) 2013, Sergey Shishmintzev
///// License: Apache/GPLv3
///// Example: http://youtu.be/bGNsrzVarfo
///// Compiler: gcc-4.7.3 (cygwin)
///// Compile command: g++ -O3 unkgen.cpp -lpng
///// P.S. Sorry for my English. It isn't my mother tongue.
/////
///// Reference:
///// [Khan1997] A.R. Khan, et.al., "VLSI architecture of a cellular automata machine", 1997,