Brainfuck-IDE

所属分类:Python编程
开发工具:Python
文件大小:24KB
下载次数:0
上传日期:2022-02-07 16:07:48
上 传 者sh-1993
说明:  用Tkinter编写的Brainfuck编辑器
(A Brainfuck editor written in Tkinter)

文件列表:
LICENSE (35149, 2022-02-08)
RUNME.py (15982, 2022-02-08)
brainfuck.png (1740, 2022-02-08)
constants.py (2010, 2022-02-08)
hello_world.bf (107, 2022-02-08)
icon.png (761, 2022-02-08)
interpreter.py (2475, 2022-02-08)
requirements.txt (9, 2022-02-08)
settings.ini (74, 2022-02-08)
widgets.py (5691, 2022-02-08)

# Python Brain***-IDE ![image](https://user-images.githubusercontent.com/77941087/116938829-a1258180-ac6b-11eb-9637-a560***92887a.png)\ A dummy Brain*** program in my editor just to f\*ck your brain ## Installation Installation is the easiest thing in the world. Just download the repo... Download link: https://github.com/rdbende/Brain***-IDE/archive/refs/heads/main.zip ...or clone it ``` git clone https://github.com/rdbende/Brain***-IDE.git ``` Run RUNME.py to use ## The program The IDE is integrated with my [Azure theme](https://github.com/rdbende/Azure-ttk-theme), for a better user experience. Just go to Settings > Download, to get a stunning appearance. There are two types of Brain*** interpreters in terms of intake. 1. You must enter the input before running the program 2. The input must be entered on the fly My editor is the second type, so you have to enter input on the fly, and since the Brain*** works to accept only one character at a time, if you have an app that needs to enter more data and compute something with it, unfortunately the program won't do anything, just constantly prompts for inputs until all 65336 bytes are full ## What is Brain***? ### TL;DR: Brain*** is the best language to f\*ck your brain. It requires a lot of logic and math, and if you don't pay enough attention, it can be completely nonsense. ### From [Wikipedia](https://en.wikipedia.org/wiki/Brain***): In 1992, Urban Mller, a Swiss physics student, took over a small online archive for Amiga software. The archive grew more popular, and was soon mirrored around the world. Today, it is the world's largest Amiga archive, known as Aminet. Mller designed Brain*** with the goal of implementing it with the smallest possible compiler, inspired by the 1024-byte compiler for the FALSE programming language. Mller's original compiler was implemented in machine language and compiled to a binary with a size of 296 bytes (yes, mine is much larger). He uploaded the first Brain*** compiler to Aminet in 1993. The program came with a "Readme" file, which briefly described the language, and challenged the reader "Who can program anything useful with it? :)". Mller also included an interpreter and some quite elaborate examples. A second version of the compiler used only 240 bytes. As Aminet grew, the compiler became popular among the Amiga community, and in time it was implemented for other platforms. #### Language design The language consists of eight commands, listed below. A brain*** program is a sequence of these commands, possibly interspersed with other characters (which are ignored). The commands are executed sequentially, with some exceptions: an instruction pointer begins at the first command, and each command it points to is executed, after which it normally moves forward to the next command. The program terminates when the instruction pointer moves past the last command. The brain*** language uses a simple machine model consisting of the program and instruction pointer, as well as a one-dimensional array of at least 30,000 byte cells initialized to zero; a movable data pointer (initialized to point to the leftmost byte of the array); and two streams of bytes for input and output (most often connected to a keyboard and a monitor respectively, and using the ASCII character encoding). Commands The eight language commands each consist of a single character: Character | Meaning -|- \> | increment the data pointer (to point to the next cell to the right). \< | decrement the data pointer (to point to the next cell to the left). \+ | increment (increase by one) the byte at the data pointer. \- | decrement (decrease by one) the byte at the data pointer. \. | output the byte at the data pointer. \, | accept one byte of input, storing its value in the byte at the data pointer. \[ | if the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] command. \] | if the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching \[ command. ## Bugs I know the IDE is far from good, and the code is a bit hacky. Current bugs: - On-close save prompts - Azure theme on Linux filedialog (looks awful) - Syntax highlighting is quite slow, it doesn't work in some cases when editing code (I don't know if it could be faster) And I would like to add these features - Auto-update with GitHub versions (just for fun) - Select editor font - Prompt on outer modification - Tabs - Search - Context menu for copy, paste, clear output, etc. If you can fix these, feel free to open a PR!

近期下载者

相关文件


收藏者