.
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BrainIDE
2 | Welcome to BrainIDE! Following will be some information about this software as well as some help about Brainfuck itself.
3 |
4 |
5 | ## What's BrainIDE?
6 | BrainIDE aims to provide an **easy-to-use, lightweight and user-friendly** brainfuck IDE. The main purpose of this piece of sowtware is to allow for
7 | brainfuck coding on the go, without the need of an Internet connection. Fully coded using python and tkinter for GUI design.
8 |
9 | | Windows version | Linux version |
10 | | - | - |
11 | |  |  |
12 |
13 | ## BrainIDE's features.
14 | BrainIDE has several features that makes it helpful and easy-to-use. The most relevant ones are automatic code highlighting, keyboard shorcuts for every
15 | action, a text-to-brainfuck translator and a charr-to-ASCII function, as well as customizing features to change the look of your code.
16 |
17 | For more advanced users, BrainIDE's interpreter can be changed by just cloning the repository and changing brainfuck_compiler.py with your own. **Note it
18 | must be renamed to _brainfuck_compiler.py_**
19 |
20 |
21 | ## How to Install BrainIDE?
22 | Installation is as easy as it could be, just go to releases, select the last release, and download the zip file corresponding to your OS (current version
23 | is only supported in Windows and Linux) and follow the intructions for your own dist. You can find these instructions in the README.txt file inside the zip
24 | file you've downloaded!
25 |
26 |
27 | ## How to contribute?
28 | All contributions and suggestions are welcome. If you´d like to contribute, clone the repo with:
29 | ```
30 | git clone https://github.com/LovetheFrogs/BrainIDE
31 | ```
32 | Send your PR's and they will be reviewed.
33 |
34 |
35 | ## Brainfuck!
36 | Continue reading for some information regarding brainfuck and how to use it.
37 |
38 |
39 | ### What is brainfuck?
40 | The following is extracted from the [Wikipedia page](https://en.wikipedia.org/wiki/Brainfuck) for brainfuck. If you would like a better insight into the
41 | history and origin of this language, I'd recommend you to head over there.
42 |
43 | >Brainfuck is an esoteric programming language created in 1993 by Urban Müller.
44 | >
45 | >Notable for its extreme minimalism, the language consists of only eight simple commands, a data pointer and an instruction pointer. While it is fully
46 | >Turing complete, it is not intended for practical use, but to challenge and amuse programmers. Brainfuck simply requires one to break commands into
47 | >microscopic steps.
48 | >
49 | >The language's name is a reference to the slang term brainfuck, which refers to things so complicated or unusual that they exceed the limits of one's
50 | >understanding.
51 |
52 | ### The language.
53 | Brainfuck is made of two main components. An array of 30k cells and a pointer to one of its cells. When a brainfuck program begins execution, the pointer
54 | is placed at cell 0 and each of the cell's values are set to 0.
55 |
56 | The programmer can manipulate the value of a cell or move to a different one, as well as looping through a set of instructions or use input/output. In
57 | total, there are 8 commands as stated above. Here you can find a table detailing the function of each oone of them.
58 |
59 | | Command | Description |
60 | | - | - |
61 | | **+** | Increment value of current cell by one. |
62 | | **-** | Decrement value of current cell by one. |
63 | | **>** | Move pointer one position to the right. |
64 | | **<** | Move pointer one position to the left.|
65 | | **[** | Start of a while loop, will repeat until cell pointet to is cero. |
66 | | **]** | Marks the end of a while loop. if the cell pointet to when reached here is noncero, it loops over. |
67 | | **.** | Used to output the ASCII value of the current cell to the screen. |
68 | | **,** | Used to input the ASCII value of one byte to the cell pointed to. |
69 |
70 | As one could have probably guessed by now, brainfuck uses ASCII codes to manage whats in the cell. This means that if cell 3 has the value '97', it
71 | actually has the letter 'a'.
72 |
73 | ### A simple introduction to programming in brainfuck.
74 | Below, you will learn how to write some code wich will print a letter. However, this is super simple. However, if you'd want to learn brainfuck from
75 | scratch, I'd recommend heading over to [**roachhd's brainfuck bacics**](https://gist.github.com/roachhd/dce54bec8ba55fb17d3a) as it deepens way more into
76 | the basics of this language.
77 |
78 | Let's code a simple program in brainfuck. This one is pretty simple and its aim is just to show how to print a character. Let's say you would like to
79 | output 'B' to screen, you could use the following code:
80 | ```
81 | ++++++[>+++++++++++<-]>.
82 | ```
83 | Lets break it down:
84 |
85 | First, we set the value of the first to 6. This will be used to iterate trough a loop and avoid the hussle of havint to type in 66 plus symbols (as 'B' in
86 | ASCII is 66 decimal).
87 |
88 | After that, we start a while loop and move to the second cell, adding 11 to it. When we are done with that, we move back to the first cell and decrease
89 | it's value by one.
90 |
91 | As we've reached the end of our loop and the current cell we're at is not 0, we iterate though again. Following there's a diagram of show the fist 3 cells
92 | look like at the start of all the loop iterations. (Note that the pointer will be pointing to the first cell at the start of each cycle).
93 |
94 | |6|0|0| ---> |5|11|0| ---> |4|22|0| ---> |3|33|0| ---> |2|44|0| ---> |1|55|0|
95 |
96 | Lastly, we move to the second cell, wich contains the value 66, and use '.' to output it's value. If you open BrainIDE, copy the code snippet above, and
97 | execute it, you will see that a letter **B** prints on the output box.
98 |
99 | So, with what you have learned, you could easily write your very own Hello World! program. I'll leave one example below, so take your time to analize it.
100 | Note that there's nos only one way to code it, so it is likely you'll see other implementations online. A commented version of the code can be found inside
101 | the repository, under CompilerApp > Premade > HelloWorld.bf
102 | ```
103 | >++++++++[<+++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-]<.>+++++++++++[<+++++>-]<.
104 | >++++++[<++++>-]<.+++.>++[<--->-]<.>++++[<-->-]<.>+++++++++++++++++[<---->-]<+.
105 | ```
106 |
107 | ## About.
108 | BrainIDE is software developed by LovetheFrogs and licensed under GPL-3.0 license.
109 |
--------------------------------------------------------------------------------
/__pycache__/brainfuck_compiler.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LovetheFrogs/BrainIDE/7403199da8fbf144f18b8af630e091df6eff8fd7/__pycache__/brainfuck_compiler.cpython-38.pyc
--------------------------------------------------------------------------------