You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,14 +15,14 @@ This is the idea behind the AI-Programmer experiment. The goal is to ultimately
15
15
16
16
## Details
17
17
18
-
The BF programming language was selected due to the fact that it consists of only 8 instructions, while being Turing complete. Theoretically, it is capable of solving any computational problem. This makes it easy to develop an interpreter, capable of running the AI-generated programs in a simulated environment. In this manner, each generated program may be executed and its performance ranked as a fitness score. Since the AI is using a Turing complete programming language, the AI itself, is also theoretically capable of solving any computational problem. However, for this experiment, the AI will focus on outputting a simple string to the console.
18
+
The underlying programming language consists of only 8 instructions, while being Turing complete. Theoretically, it is capable of solving any computational problem. This makes it easy to develop an interpreter, capable of running the AI-generated programs in a simulated environment. In this manner, each generated program may be executed and its performance ranked as a fitness score. Since the AI is using a Turing complete programming language, the AI itself, is also theoretically capable of solving any computational problem. However, for this experiment, the AI will focus on outputting a simple string to the console.
19
19
20
20
## How It Works
21
21
22
22
AI-Programmer works as follows:
23
23
24
24
- A genome consists of an array of doubles.
25
-
- Each gene corresponds to an instruction in the BF programming language.
25
+
- Each gene corresponds to an instruction in the programming language.
26
26
- Start with a population of random genomes.
27
27
- Decode each genome into a resulting program by converting each double into its corresponding instruction and execute the program.
28
28
- Get each program's fitness score, based upon the output it writes to the console (if any), and rank them.
@@ -64,7 +64,7 @@ The AI successfully wrote a program to output "hi" after 5,700 generations in ab
64
64
65
65
While the above code contains parsing errors, such as non-matching brackets, our simulation interpreter computes the result up until the program fails, so in the above case, the syntax error (which is later on in the code, after a solution is found) doesn't impact the fitness.
66
66
67
-
You can try pasting the above code into a BF[interpreter](http://www.iamcal.com/misc/bf_debug/). Click "Start Debugger", ignore the warnings, then click Run To Breakpoint. Note the output.
67
+
You can try pasting the above code into an online[interpreter](http://www.iamcal.com/misc/bf_debug/). Click "Start Debugger", ignore the warnings, then click Run To Breakpoint. Note the output.
68
68
69
69
If we trim off the excess code, we see the following syntactically-valid code:
70
70
@@ -102,7 +102,7 @@ More complex programs could likely be generated while using faster PCs. Next ste
102
102
103
103
## Quick-Start Guide to Using the Code
104
104
105
-
By default, the code is configured to use the BF Classic instruction set and to write a program to output a string. To change the string that is generated, simply expand the "Private Variables" section and change the text for TargetString to your desired value.
105
+
By default, the code is configured to use the Classic instruction set and to write a program to output a string. To change the string that is generated, simply expand the "Private Variables" section and change the text for TargetString to your desired value.
0 commit comments