Language Kolmogorov
(The implementor's version)
Date: | 03/11/09 |
Author: | Johnny Morrice |
URL: | http://www.killersmurf.com |
Comments: | 1 |
Info: | http://www.killersmurf.com/projects/Kolmogorov |
Score: | (2.80 in 5 votes) |
a\3{CODE} "this points to the edge of the network we're currently working on" a{CODE}\1 "this is the central node of the third iteration network" a{CODE}\2 "this is the central node of the second iteration network" a{CODE}\3 "this is the central node of the first iteration network" a\120\31 "the top of the character edges in the first network" a\117\32 "the top of the character edges in the second network" a\115\33 "the top of the character edges in the third network" "join these totals to the networks" j\3\31{CODE} j\2\32{CODE} j\1\33{CODE} j\33*{CODE} "join the third total to the start node" a{CODE}\4 "the first of the character edges to be used in the first iteration network" a{CODE}\5 "the first of the character edges to be used in the second iteration network" "join the iteration networks to the nodes holding the number of characters in the network" j\2\5\1 j\3\4\1 a\83\34 "this holds the total value of the first iterator" j\3\34\2 "join that node to the first network" a{CODE}\35 "this node is used as the first iterator in the first network -- after 83 iterations, 1 will be deducted from y, before moving on to use the character node as the iterator" j\3\35\3 a\31\36 "this node holds the total value of the second iterator" j\3\36\4 a{CODE}\37 "this node will be used as the second iterator in the first network" j\3\37\5 j\3*\6 "join the first network to the start node" a\81\38 "this holds the total value of the first iterator" j\2\38\2 "join that node to the second network" a{CODE}\39 "this node is used as the first iterator in the second network -- after 81 iterations, 1 will be deducted from y, before moving on to use the character node as the iterator" j\2\39\3 "join that node to the second network" a\30\40 "this node holds the total value of the second iterator" j\2\40\4 a{CODE}\41 "this node will be used as the second iterator in the second network" j\2\41\5 j\2*\6 "join the second network to the start node" a\10\42 "this is the iterator for the 10 first decimal steps ie 9876543210" "these nodes hold the character data used in 99 bottles" a\9\7 "x" a{CODE}\8 "y" a\98\9 "b" a\111\10 "o" a\116\11 "t" a\108\12 "l" a\101\13 "e" a\32\14 " " a\102\15 "f" a\114\16 "r" a\104\17 "h" a\119\18 "w" a\97\19 "a" a\10\20 "\n" a\107\21 "k" a\110\22 "n" a\100\23 "d" a\112\24 "p" a\115\25 "s" a\105\26 "i" a\117\27 "u" a\109\28 "m" a\57\29 "this will hold the ascii value of X" a\57\30 "this will hold the ascii value of Y" "the next section joins the iteration network nodes to the data nodes with the edges corrosponding to the character position" j\3\29\120 "x" j\3\30\119 "y" j\3\14\118 " " j\3\9\117 "b" j\3\10\116 "o" j\3\11\115 "t" j\3\11\114 "t" j\3\12\113 "l" j\3\13\112 "e" j\3\25\111 "s" j\3\14\110 " " j\3\10\109 "o" j\3\15\108 "f" j\3\14\107 " " j\3\9\106 "b" j\3\13\105 "e" j\3\13\104 "e" j\3\16\103 "r" j\3\14\102 " " j\3\10\101 "o" j\3\22\100 "n" j\3\14\99 " " j\3\11\98 "t" j\3\17\97 "h" j\3\13\96 "e" j\3\14\95 " " j\3\18\94 "w" j\3\19\93 "a" j\3\12\92 "l" j\3\12\91 "l" j\3\20\90 "\n" j\3\29\89 "x" j\3\30\88 "y" j\3\14\87 " " j\3\9\86 "b" j\3\10\85 "o" j\3\11\84 "t" j\3\11\83 "t" j\3\12\82 "l" j\3\13\81 "e" j\3\25\80 "s" j\3\14\79 " " j\3\10\78 "o" j\3\15\77 "f" j\3\14\76 " " j\3\9\75 "b" j\3\13\74 "e" j\3\13\73 "e" j\3\16\72 "r" j\3\20\71 "\n" j\3\11\70 "t" j\3\19\69 "a" j\3\21\68 "k" j\3\13\67 "e" j\3\14\66 " " j\3\10\65 "o" j\3\22\64 "n" j\3\13\63 "e" j\3\14\62 " " j\3\23\61 "d" j\3\10\60 "o" j\3\18\59 "w" j\3\22\58 "n" j\3\14\57 " " j\3\19\56 "a" j\3\22\55 "n" j\3\23\54 "d" j\3\14\53 " " j\3\24\52 "p" j\3\19\51 "a" j\3\25\50 "s" j\3\25\49 "s" j\3\14\48 " " j\3\26\47 "i" j\3\11\46 "t" j\3\14\45 " " j\3\19\44 "a" j\3\16\43 "r" j\3\10\42 "o" j\3\27\41 "u" j\3\22\40 "n" j\3\23\39 "d" j\3\20\38 "\n" j\3\29\37 "x" j\3\30\36 "y" j\3\14\35 " " j\3\9\34 "b" j\3\10\33 "o" j\3\11\32 "t" j\3\11\31 "t" j\3\12\30 "l" j\3\13\29 "e" j\3\25\28 "s" j\3\14\27 " " j\3\10\26 "o" j\3\15\25 "f" j\3\14\24 " " j\3\9\23 "b" j\3\13\22 "e" j\3\13\21 "e" j\3\16\20 "r" j\3\14\19 " " j\3\10\18 "o" j\3\22\17 "n" j\3\14\16 " " j\3\11\15 "t" j\3\17\14 "h" j\3\13\13 "e" j\3\14\12 " " j\3\18\11 "w" j\3\19\10 "a" j\3\12\9 "l" j\3\12\8 "l" j\3\20\7 "\n" j\2\30\117 "y" j\2\14\116 " " j\2\9\115 "b" j\2\10\114 "o" j\2\11\113 "t" j\2\11\112 "t" j\2\12\111 "l" j\2\13\110 "e" j\2\25\109 "s" j\2\14\108 " " j\2\10\107 "o" j\2\15\106 "f" j\2\14\105 " " j\2\9\104 "b" j\2\13\103 "e" j\2\13\102 "e" j\2\16\101 "r" j\2\14\100 " " j\2\10\99 "o" j\2\22\98 "n" j\2\14\97 " " j\2\11\96 "t" j\2\17\95 "h" j\2\13\94 "e" j\2\14\93 " " j\2\18\92 "w" j\2\19\91 "a" j\2\12\90 "l" j\2\12\89 "l" j\2\20\88 "\n" j\2\30\87 "y" j\2\14\86 " " j\2\9\85 "b" j\2\10\84 "o" j\2\11\83 "t" j\2\11\82 "t" j\2\12\81 "l" j\2\13\80 "e" j\2\25\79 "s" j\2\14\78 " " j\2\10\77 "o" j\2\15\76 "f" j\2\14\75 " " j\2\9\74 "b" j\2\13\73 "e" j\2\13\72 "e" j\2\16\71 "r" j\2\20\70 "\n" j\2\11\69 "t" j\2\19\68 "a" j\2\21\67 "k" j\2\13\66 "e" j\2\14\65 " " j\2\10\64 "o" j\2\22\63 "n" j\2\13\62 "e" j\2\14\61 " " j\2\23\60 "d" j\2\10\59 "o" j\2\18\58 "w" j\2\22\57 "n" j\2\14\56 " " j\2\19\55 "a" j\2\22\54 "n" j\2\23\53 "d" j\2\14\52 " " j\2\24\51 "p" j\2\19\50 "a" j\2\25\49 "s" j\2\25\48 "s" j\2\14\47 " " j\2\26\46 "i" j\2\11\45 "t" j\2\14\44 " " j\2\19\43 "a" j\2\16\42 "r" j\2\10\41 "o" j\2\27\40 "u" j\2\22\39 "n" j\2\23\38 "d" j\2\20\37 "\n" j\2\30\36 "y" j\2\14\35 " " j\2\9\34 "b" j\2\10\33 "o" j\2\11\32 "t" j\2\11\31 "t" j\2\12\30 "l" j\2\13\29 "e" j\2\25\28 "s" j\2\14\27 " " j\2\10\26 "o" j\2\15\25 "f" j\2\14\24 " " j\2\9\23 "b" j\2\13\22 "e" j\2\13\21 "e" j\2\16\20 "r" j\2\14\19 " " j\2\10\18 "o" j\2\22\17 "n" j\2\14\16 " " j\2\11\15 "t" j\2\17\14 "h" j\2\13\13 "e" j\2\14\12 " " j\2\18\11 "w" j\2\19\10 "a" j\2\12\9 "l" j\2\12\8 "l" j\2\20\7 "\n" j\1\30\115 "y" j\1\14\114 " " j\1\9\113 "b" j\1\10\112 "o" j\1\11\111 "t" j\1\11\110 "t" j\1\12\109 "l" j\1\13\108 "e" j\1\14\107 " " j\1\10\106 "o" j\1\15\105 "f" j\1\14\104 " " j\1\9\103 "b" j\1\13\102 "e" j\1\13\101 "e" j\1\16\100 "r" j\1\14\99 " " j\1\10\98 "o" j\1\22\97 "n" j\1\14\96 " " j\1\11\95 "t" j\1\17\94 "h" j\1\13\93 "e" j\1\14\92 " " j\1\18\91 "w" j\1\19\90 "a" j\1\12\89 "l" j\1\12\88 "l" j\1\20\87 "\n" j\1\30\86 "y" j\1\14\85 " " j\1\9\84 "b" j\1\10\83 "o" j\1\11\82 "t" j\1\11\81 "t" j\1\12\80 "l" j\1\13\79 "e" j\1\14\78 " " j\1\10\77 "o" j\1\15\76 "f" j\1\14\75 " " j\1\9\74 "b" j\1\13\73 "e" j\1\13\72 "e" j\1\16\71 "r" j\1\20\70 "\n" j\1\11\69 "t" j\1\19\68 "a" j\1\21\67 "k" j\1\13\66 "e" j\1\14\65 " " j\1\10\64 "o" j\1\22\63 "n" j\1\13\62 "e" j\1\14\61 " " j\1\23\60 "d" j\1\10\59 "o" j\1\18\58 "w" j\1\22\57 "n" j\1\14\56 " " j\1\19\55 "a" j\1\22\54 "n" j\1\23\53 "d" j\1\14\52 " " j\1\24\51 "p" j\1\19\50 "a" j\1\25\49 "s" j\1\25\48 "s" j\1\14\47 " " j\1\26\46 "i" j\1\11\45 "t" j\1\14\44 " " j\1\19\43 "a" j\1\16\42 "r" j\1\10\41 "o" j\1\27\40 "u" j\1\22\39 "n" j\1\23\38 "d" j\1\20\37 "\n" j\1\22\36 "n" j\1\10\35 "o" j\1\14\34 " " j\1\28\33 "m" j\1\10\32 "o" j\1\16\31 "r" j\1\13\30 "e" j\1\14\29 " " j\1\9\28 "b" j\1\10\27 "o" j\1\11\26 "t" j\1\11\25 "t" j\1\12\24 "l" j\1\13\23 "e" j\1\25\22 "s" j\1\14\21 " " j\1\10\20 "o" j\1\15\19 "f" j\1\14\18 " " j\1\9\17 "b" j\1\13\16 "e" j\1\13\15 "e" j\1\16\14 "r" j\1\14\13 " " j\1\10\12 "o" j\1\22\11 "n" j\1\14\10 " " j\1\11\9 "t" j\1\17\8 "h" j\1\13\7 "e" j\1\14\6 " " j\1\18\5 "w" j\1\19\4 "a" j\1\12\3 "l" j\1\12\2 "l" j\1\20\1 "\n" +*\3 "set the value of the root node to 3" a\99\48 "create a node that runs from values 99-1 - the current iteration" [\42 "loop until the main iterator is zero" [\30 -\30\1 "reset the value of ascii Y" ] +\8\9 "set the value of Y to 9" +\30\57 "set the of ascii Y to ascii 9" [\8 "loop until Y is zero" ap\48\45 "create a new node with the value of the current iteration - let's call it Z" -\45\1 "subtract one from Z" a\1\46 "create a new node with value one - lets call it Q" [\45 "if the current iteration has a value > 1, that is Z has a value > 0" a{CODE}\45 "set the value of Z to 0, so the loop doesn't loop" a{CODE}\46 "set the value of Q to 0" sp* "seek to the network node with the address of the value of the active node" +\1p{CODE} "add the total character number to the character register" +\3p\2 "add the value at the first iterator total to the first iterator" +\5p\4 "add the value at the second iterator total to the second iterator" [\3 "loop until the value of first iterator is 0" op\1 "output the character at the node which has the adress of the value of the character node" -\1\1 "decrement the character node" -\3\1 "decrement the first iterator" ] s\6 "seek to the start node" -\8\1 "subtract one from Y" -\30\1 "subtract one from the ascii value of Y" sp* "seek back to the network" [\5 "loop until the value of the second iterator is 0" op\1 "output the character at the node which has the address of the value o the character node" -\1\1 "decrement the character node" -\5\1 "decrement the second iterator" ] a{CODE}\1 "set the character register to 0" s\6 "seek to the main node" -\48\1 "subtract one from the current iteration" ] [\46 "if Q > 0" s\1 "seek to the third iteration network" [{CODE} "while the character register > 0" op{CODE} "output the character pointed to by the register" -{CODE}\1 ] s{CODE} "seek to the character node" s{CODE} "seek to the start node" a{CODE}\46 "end this loop" a{CODE}\8 "subtract one from y" ] ] -\7\1 "subtract one from X" -\29\1 "subtract one from the ascii value of X" ap\7\43 "create a new node with the value of X" a\1\44 "create a node ( lets call it Z )" [\43 "if the node with the value of X is greater than 0" a{CODE}\44 "give Z the value 0" a{CODE}\43 "end this loop" ] [\44 "if Z has a value greater than 0" -*\1 "decrement the main node" a{CODE}\44 "end this loop" ] -\42\1 "subtract one from the main iterator" -\48\1 "subtract one from the iteration number" ]
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments
Johnny Morrice said on 03/25/09 10:32:14
Note: Somehow all mentions of {TEXT} in the source above were escaped to the string {CODE}.
In case that is also escaped: what I mean to say is all mentions of \ 0 ( without the space were escaped to the string {CODE}