{"id":23097092,"url":"https://github.com/alexcoder04/brainfuck","last_synced_at":"2025-07-19T15:42:36.905Z","repository":{"id":114988122,"uuid":"550373788","full_name":"alexcoder04/brainfuck","owner":"alexcoder04","description":"Embedable Brainfuck interpreter","archived":false,"fork":false,"pushed_at":"2022-10-12T16:50:49.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T08:24:11.026Z","etag":null,"topics":["bf","brainfuck","brainfuck-interpreter","brainfuck-language","esoteric-language","interpreter","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexcoder04.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-12T16:49:16.000Z","updated_at":"2022-10-12T16:51:20.000Z","dependencies_parsed_at":"2023-03-13T13:04:10.904Z","dependency_job_id":null,"html_url":"https://github.com/alexcoder04/brainfuck","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcoder04%2Fbrainfuck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcoder04%2Fbrainfuck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcoder04%2Fbrainfuck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcoder04%2Fbrainfuck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexcoder04","download_url":"https://codeload.github.com/alexcoder04/brainfuck/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247070927,"owners_count":20878586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bf","brainfuck","brainfuck-interpreter","brainfuck-language","esoteric-language","interpreter","python"],"created_at":"2024-12-16T22:51:20.663Z","updated_at":"2025-04-03T20:15:44.572Z","avatar_url":"https://github.com/alexcoder04.png","language":"Python","readme":"# BF interpreter in Python\n\nAn embedable brainfuck interpreter, written with a friend just for fun.\n\n## Usage in a Python script\n```python\nfrom interpreter import Interpreter\n\ninterpreter = Interpreter()\ninterpreter.run_file(\"your_code.bf\")\ninterpreter.print_debug_info()\n# ...\n```\n## Methods\n\n### Reset interpreter: `interpreter.reset()`\n\nResets the memory, the cell pointer and the loops.\n\n### Run BF file: `interpreter.run_file(filename: str)`\n\nOpens the file and runs it.\n\n### Open console: `interpreter.console()`\n\nStarts a BF console where you can live run BF code and run additional commands.\n\n### Run BF code: `interpreter.run_code(code: str, extra_commands: bool)`\n\nRuns bf code.\nWith `extra_commands`, you can decide whether those can be run or not (see below).\n\n### Modify current cell: `interpreter.modify_current_cell(mode: bool)`\n\nEquivalent to +/- BF command. Set `mode` to `True` if you want `+` or `False` if you want `-`.\n\n### Execute command: `interpreter.execute(command: chr)`\n\nExecutes a single BF command.\n\n### Debug info: `interpreter.print_debug_info()`\n\nPrints information like current memory state, current cell pointer and loops.\n\n### Help: `interpreter.print_help()`\n\nPrints some help.\n\n# Console\n\nYou can start a bf console by calling `interpreter.console()`.\nIn there, you can run raw bf code and extra commands.\n\n## Extra commands\n\nExtra commands are commands that not belong to the standard Brainfuck.\nThese are some Vim-inspired bindings which can be useful for the interactive bf console.\nThey must be on a separate line, start with `:` and `interpreter.run_code` must receive the argument `extra_commands=True`.\n\n### Exit: `:q`, `:quit`, `:exit`\n\n### Run file: `:e path/to/file.bf`\n\n### Reset interpreter: `:r`\n\n### Clear the console: `:l`\n\n### Print help text: `:help`\n\n### Write code that was run in the session to a file: `:w path/to/file.bf`\n\n# Scripting\n\nYou can also write files with bf code and execute them.\nYou can use all normal commands and extra commands there.\nYou can also create one-line-comments with `;`. Example:\n\n```brainfuck\n; a program that prints \"hello\"\n; prints h\n++++++[\u003e++++++++++++\u003c-]\n\u003e.[-]\u003c\n; prints e\n++++++++++[\u003e++++++++++\u003c-]\u003e+\u003c\n\u003e.[-]\u003c\n; prints l two times\n+++++++++[\u003e++++++++++++\u003c-]\n\u003e..[-]\u003c\n; prints o\n+++++++++++[\u003e++++++++++\u003c-]\u003e+\u003c\n\u003e.[-]\u003c\n```\n\n# bfrc\nLike in most scripting languages, bf has an autorun file, which is executed every time the console is opened.\nThe bfrc file is just a normal bf script, whch can contain special commands.\nIt must be located in `$XDG_CONFIG_HOME/bf/bfrc`. ($XDG_CONFIG_HOME should be set to `$HOME/.config` on most Linux systems).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexcoder04%2Fbrainfuck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexcoder04%2Fbrainfuck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexcoder04%2Fbrainfuck/lists"}