Skip to content

Instantly share code, notes, and snippets.

//c++ rule30.cpp -o rule30
#include
int i,j,l,r,o[80]={},t[80]={};
char c;
int main(){
std::cout<<"enter character, then return >> ";
std::cin>>c;
o[39]=1;
while(1){
for(j=0;j<80;j++){

Keybase proof

I hereby claim:

  • I am shawnlawson on github.
  • I am shawnlawson (https://keybase.io/shawnlawson) on keybase.
  • I have a public key ASAIvXNh28HTNahI4Zm4nsejDwBLAKmj9lwlX7GolhYTxwo

To claim this, I am signing this object:

@shawnlawson
shawnlawson / exp.frag
Created September 14, 2017 12:26
Force Experiment 013
void main() {
vec2 st = st()+vec2(bands.y-bands.x + sin(time* 5.), bands.y - bands.z- sin(time))*.5, stN = stN(); vec3 c = black;
st *= noise(st+time);
float theta = atan(st.x, st.y) / PI2; float phi = log(length(st));
float k = 2.; float a = mod(theta, PI2/k); a = abs(a - PI2/k/2.) * 2.;
float f = vrmf(vec2(phi * .5 + time - bands.z * 2., a) * vec2(.25 + bands.x * 1.), int(1. + bands.y * 2.));
c = f * hsv2rgb(vec3(time * .1 - bands.x, .8, .5)) * 6.;
@shawnlawson
shawnlawson / exp.frag
Created August 28, 2017 19:32
Force Experiment 012
void main() {
//note modification of origin
vec2 st = st()+vec2(bands.y-bands.x + sin(time), bands.y - bands.z- sin(time))*1.1, stN = stN(); vec3 c = black;
float theta = atan(st.x, st.y) / PI2; float phi = log(length(st));
float k = 2.*bands.z* 1.; float a = mod(theta, PI2/k); a = abs(a - PI2/k/2.) * 2.;
st = vec2(a, phi *.2 - time*.9);
st = rotate(vec2(0), st, time*20.);
float f = vrmf(st *
vec2(.9 + bands.y * .1, 1. + 1. * bands.y) +
@shawnlawson
shawnlawson / exp.frag
Created June 5, 2017 17:21
Force Experiment 011
void main() {
vec2 st = st(), stN = stN(); vec3 c = black;
float theta = atan(st.x, st.y) / PI2; float phi = log(length(st));
float k = 1. * bands.y + 5.; float a = mod(theta, PI2/k); a = abs(a - PI2/k/2.) * 3.;
vec2 r = rotate(vec2(0) - vec2(cos(time)), abs(st * 2.)+sin(st+noise(time*.2))*(3.+ bands.z), time * .33 + bands.w);
vec2 r2 = rotate(vec2(0) + vec2(sin(time)), vec2(theta * a + time, phi - time) * bands.z, -time * .27 - bands.y);
float f = noise(r * vec2(10., .05) + time + bands.x);
@shawnlawson
shawnlawson / exp.frag
Created May 5, 2017 13:46
Force Experiment 010
void main() {
vec2 st = st(), stN = stN(); vec3 c = white;
float theta = atan(st.x, st.y) / PI2; float phi = log(length(st));
float k = 1. * bands.y + 5.; float a = mod(theta, PI2/k); a = abs(a - PI2/k/2.) * 3.;
st += floor(st * 50. * length(bands));
float n = 1. - noise(st * 100. * vec2(bands.x * .002, .1) + vec2(bands.y, time * .2 - bands.z * 20.) );
// float n2 = 1. - noise(st * 300.* vec2(bands.y * .02, 1) + n + vec2(-bands.y, -time * 400.2 - bands.y * 200.));
// float n3 = 1. - noise(st * 200.* vec2(bands.z * .01, 1) + n2 + vec2(bands.x, time * 800.5 - bands.x * 200.) );
@shawnlawson
shawnlawson / exp.frag
Created April 28, 2017 13:22
Force Experiment 009
void main() {
vec2 st = st(), stN = stN(); vec3 c = white * .5;
float theta = atan(st.x, st.y) / PI2; float phi = log(length(st));
float k = 1. * bands.y + 5.; float a = mod(theta, PI2/k); a = abs(a - PI2/k/2.) * 3.;
vec2 p = mix(vec2(a * 6. * bands.y + st.y * bands.z + a*2., phi + phi * (3.+ bands.y * 4.) + time * .1), st, bands.x);
p = rotate(vec2(0), p, time - bands.y - bands.z);
p = fract(p * (1.+ bands.y));
@shawnlawson
shawnlawson / exp.frag
Created April 21, 2017 14:09
Force Experiment 008
void main() {
vec2 st = st(), stN = stN(); vec3 c = white * .5;
float theta = atan(st.x, st.y) / PI2; float phi = log(length(st));
float k = 1. * bands.y + 2.; float a = mod(theta, PI2/k); a = abs(a - PI2/k/2.);
vec2 p = floor(vec2(a * 3., phi + time * 1.2 + bands.x) * 2.) * length(bands) * 2.;
vec2 q = vec2(sin(p.x), sin(p.y)) ;
float t = time * 4.13 + q.x * q.y * length(q);
@shawnlawson
shawnlawson / exp.frag
Last active April 16, 2017 15:44
Force Experiment 007
void main() {
vec2 st = st(), stN = stN(); vec3 c = white * .5;
float theta = atan(st.x, st.y) / PI2; float phi = log(length(st));
float k = 1. * bands.y + 2.; float a = mod(theta, PI2/k); a = abs(a - PI2/k/2.);
vec2 pq = fract( st * (.01 + length(bands)*1.));
pq = rotate(vec2(0), pq, time - bands.z);
pq = fract(pq);
@shawnlawson
shawnlawson / exp.frag
Created March 31, 2017 18:32
Force Experiment 006
void main() {
vec2 st = st(), stN = stN(); vec3 c = black;
float theta = atan(st.x, st.y) / PI2; float phi = log(length(st));
float k = 1. * bands.y + 2.; float a = mod(theta, PI2/k); a = abs(a - PI2/k/2.);
vec2 r = rotate(vec2(bands.y - bands.x) * 2., st, time * .2 + bands.x);
vec2 r2 = rotate(vec2(bands.x - bands.y) * 2., st, time * .2 - bands.x);
vec3 v = voronoi(vec3(r * 3. * bands.y + st, bands.y * .3 + time * .1));