Simple Code As An Algorithm To Generate Nature

13
of 1 13 Simple Code As An Algorithm To Generate Nature by Ian Beardsley copyright © 2016 by Ian Beardsley (February 4, 2016)

description

We write simple code that generates nature.

Transcript of Simple Code As An Algorithm To Generate Nature

Page 1: Simple Code As An Algorithm To Generate Nature

� of �1 13

Simple Code As An Algorithm To Generate Nature

by

Ian Beardsley

copyright © 2016 by Ian Beardsley (February 4, 2016)

Page 2: Simple Code As An Algorithm To Generate Nature

� of �2 13

The Code

Page 3: Simple Code As An Algorithm To Generate Nature

� of �3 13

print("The basic substances from which life formed on early earth are: ") print("CH4 (Methane), NH3 (Ammonia), H2O (water), H2 (hydrogen gas)") print("The idea of Wolfram is if we can describe something complex,...") print("with a few short lines of source code, then ") print("this can be an alternative to using mathematics ") print("to describe Nature. ") print("Because these substances from which life are made of, ") print("elements 6 (C), 7 (N). 8(O) of the period table and H, ") print("a simple loop can be written, because the C, N, and O, ") print("progress in increments of one, while the H decrements. ") print("as such we write code to make the pyramid of life.")

k=4; x=1; z=4; while (x!=k): x=x+1 z=z-1 print(x*"H"+z*"C");

print("Where we say HH=H2, HHH=H3, HHHH=H4, and,...") print("CCC = O, CC = N, and C = C.")

print("Cellular Automata For The Ductile Conducting Wires") print("Cu=1, Ag=2, Au=3")

x=0 while (x!=3): x=x+1 print(str(x))

print("The regular tessellators are the regular geometries that can") print("cover a surface without leaving gaps.") print(" ") print("regular hexagon:")

x=0 while (x!=3): x=x+1 if (x==1 or x==3): print(2*" "+"***"+" ") if (x==3): break; print("*"+5*" "+"*") print("regular triangle (equilateral triangle):") z=0 print(3*" "+"*"+2*" ")

Page 4: Simple Code As An Algorithm To Generate Nature

� of �4 13

while (z!=2): z=z+1 print(3*" ") print("*"+5*" "+"*") print("regular parallelagram (square):") y=0 while (y!=3): y=y+1 if (y==1 or y==3): print("*"+3*" "+"*") if (y==3): break; print(4*" ") print("Pythagoras thought the tetractys was the key to the universe") print("It is the triangle such that: 1, 1+1=2, 2+1=3, 3+1=4") print("which is 1+2+3+4=10") print(" ") y=4 x=0 while (x!=4): x=x+1 y=y-1 print(y*" "+x*"* ")

print ("It is useful to make the code, "); print ("that produces the four molecular structures, "); print ("of the hydrocarbons, which make up organic substances.");

print (" "); print (" "); print ("Arenes"); print (" "); print (" "); print (" "); print (" "); print (" | "); print (" C "); print ("--C = --C --"); print (" | || "); print ("--C C --"); print (" = C-- "); print (" | "); print (" "); print (" "); print (" "); print ("Alkanes"); print (" "); print (" ");

Page 5: Simple Code As An Algorithm To Generate Nature

� of �5 13

print (" "); print (" | | "); print (" -- C -- C -- "); print (" | | "); print (" "); print (" "); print (" "); print ("Alkenes"); print (" "); print (" "); print (" "); print (" | | "); print (" -- C = C -- "); print (" "); print (" "); print (" "); print ("Alkynes"); print (" "); print (" "); print (" "); print (" -- "); print ("-- C -- C -- "); print (" -- "); print (" "); print (" "); print (" "); print ("We define galaxies in their classification scheme"); print ("with source code:"); print (" "); print (" "); print (" "); print ("Barred Spiral Galaxy (SBc)"); print (" "); print (" "); print (" "); print (2*" " + "*" ); print ("*"); print (2*"*"+10*" " +2*"*"); print (7*"*"+12*" "+7*"*"); print (12*" "+2*"*"+10*" "+2*"*"); print (25*" "+ "*"); print (24*" "+"*"); print (" "); print (" "); print (" "); print ("Spriral Galaxy (Sc)"); print (" "); print (" "); print (" ");

Page 6: Simple Code As An Algorithm To Generate Nature

� of �6 13

print (25*" "+ "*"); print (33*" "+"*"); print (35*" "+"*"); print (9*" "+"*"+" " +"*"+24*" " + "*"); print (6*" "+4*"*"+10*" "+ 2*"*"+13*" "+2*"*"); print (4*" "+3*"*"+12*" "+4*"*"+11*" "+3*"*"); print (3*" "+2*"*"+15*" "+2*"*"+10*" "+4*"*"); print (4*" "+24*" " +"*"+" "+"*"); print (6*" "+"*"); print (9* " "+"*"); print (15*" "+"*"); print(" "); print (" "); print (" "); print ("Elliptical Galaxy (E0)"); print (5*" "+"*"); print (4*" "+3*"*"); print (5*" "+ "*"); print ("water chemistry:"); print (" "); print (" "); print (2*"H"+"O"+2*" "+2*"H"+"O"+2*" "+"O"+"="+"2-"); print ("-HH"+ " " + "-O"+2*" "+"H"+"="+"+"); print ( " O"+" "+ "HH"+" "+ "=""Neutral H2O"); print (" "); print (" "); print ("Dehydration Synthesis"); print ("HHO"+" "+"HHO"); print ("-OH"+" "+"-H" ); print ("H+" +" "+" OH-"); print ("Neutral HHO=H2O"); print (" "); print (" "); print ("Hyrolosis"); print (" "); print (" "); print ("HHO"); print ("OH-"+" "+"H+"); print ("+H+"+" "+"+OH-"); print ("H2O and H2O”); print(" ")

Page 7: Simple Code As An Algorithm To Generate Nature

� of �7 13

print("i1=Boron") print("j =Silicon") print("i2=Gallium") print("k1=Nitrogen") print("k2=Arsenic") print("integrated circuitry") print(" ") x=0 while (x!=3): x=x+1 if (x==1 or x==3): print("i"+" "+"k") if (x==3): break; print(" "+"j"+" ")

Page 8: Simple Code As An Algorithm To Generate Nature

� of �8 13

Running The Code

Page 9: Simple Code As An Algorithm To Generate Nature

� of �9 13

Page 10: Simple Code As An Algorithm To Generate Nature

� of �10 13

Page 11: Simple Code As An Algorithm To Generate Nature

� of �11 13

Page 12: Simple Code As An Algorithm To Generate Nature

� of �12 13

Page 13: Simple Code As An Algorithm To Generate Nature

� of �13 13

The Author