From 2fbaee3121a210442f22d2d8f86242bc2d47b111 Mon Sep 17 00:00:00 2001 From: Idris Musa Date: Sat, 15 Oct 2022 15:28:59 +0100 Subject: [PATCH 1/7] Translated the README.md to Arabic Language --- README.md | 98 +++++++++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 4305653..5da1808 100644 --- a/README.md +++ b/README.md @@ -4,82 +4,82 @@

-# brainfuc*k interpreter: a simple brainfuc*k interpreter and REPL writen in rust 🦀 +# مترجم brainfu* k: مترجم بسيط من Brainfuc * K و REPL مكتوب في Rust 🦀 -## Features -- Run brainfuc*k code from a file 💫 -- Run brainfuc*k live code from the REPL 🚀 -- Support utf-8 characters including emojis 😍 (optional) -- You can control in the array size 📏 +## سمات +- قم بتشغيل كود brainfu * k من ملف 💫 +- قم يسمح Brainfu * k الكود المباشر من REPL 🚀 +- دعم أحرف UTF-8 بما في ذلك الرموز التعبيرية 😍 (اختياري) +- يمكنك التحكم في حجم المصفوفة 📏 -## Install +## تثبيت -- from crates.io +- تثبيت crates.io: ```shell cargo install bfy ``` -- From aur: +- من aur: ```shell yay -S bfy ``` -## Options and arguments +## الخيارات والحجج
- Options table + جدول الخيارات - - - + + + - + - + - + - + - + @@ -88,7 +88,7 @@
-Help option output +مساعدة خيار الإخراج ```shell bfy --help @@ -135,7 +135,7 @@ Options:
-### Examples +### أمثلة ```bash bfy test_code/hello_world.bf @@ -172,7 +172,7 @@ Hi yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! bfy test_code/like_cat.bf ``` ![output](./screenshots/like_cat_output.png) -> Note: The output is not the same as the current version of the interpreter, but it is the same as the output of the interpreter when I wrote the code. +> ملاحظة: الإخراج ليس هو نفسه الإصدار الحالي للمترجم الفوري ، ولكنه مماثل لإخراج المترجم الفوري عندما أكتب الكود. ## REPL ```bash @@ -180,18 +180,18 @@ bfy # REPL mode ``` ![print @ and A in the repl](./screenshots/repl_print_at_and_A_0.1.0.png) -## TODO -- [ ] Add more tests -- [ ] Add more examples -- [ ] Create the brainfuck formatter -- [ ] Add syntax highlighting in the REPL -- [ ] Add auto completion in the REPL -- [ ] Support dynamic array size feature +## لكى يفعل +- [ ] أضف المزيد من الاختبارات +- [ ] أضف المزيد من الأمثلة +- [ ] قم بإنشاء منسق brainfu * k +- [ ] أضف تمييز بناء الجملة في REPL +- [ ] أضف الإكمال التلقائي في REPL +- [ ] دعم ميزة حجم الصفيف الديناميكي -## Resources -- [Brainfuck in wikipedia](https://en.wikipedia.org/wiki/Brainfuck) -- [Programming in Brainfuck](http://cydathria.com/bf/brainfuck.html) -- [Brainfuck: An Eight-Instruction Turing-Complete Programming Language](http://www.muppetlabs.com/~breadbox/bf) -- [brainfuck-visualizer](https://github.com/usaikiran/brainfuck-visualizer) -- [Basics of BrainFuck](https://gist.github.com/roachhd/dce54bec8ba55fb17d3a) -- [An elegant programming language: Brainfuck](https://www.neperos.com/article/raqehg6b24ceadba) \ No newline at end of file +## مصادر +- [مخنث فى ويكيبيديا](https://en.wikipedia.org/wiki/Brainfuck) +- [البرمجة في Brainfuck](http://cydathria.com/bf/brainfuck.html) +- [Brainfuck: لغة برمجة Turing-Complete ذات ثمانية تعليمات](http://www.muppetlabs.com/~breadbox/bf) +- [Brainfuc * k- متخيل](https://github.com/usaikiran/brainfuck-visualizer) +- [أساسيات BrainFuck](https://gist.github.com/roachhd/dce54bec8ba55fb17d3a) +- [لغة برمجة أنيقة: Brainfuck](https://www.neperos.com/article/raqehg6b24ceadba) From c0b95c6af194276ee2953c9fcda1b3d2e3e10083 Mon Sep 17 00:00:00 2001 From: Idris Musa Date: Sat, 15 Oct 2022 20:12:54 +0100 Subject: [PATCH 2/7] File Renamed to README-ar.md Corrections made to Arabic Translations --- README.md => README-ar.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) rename README.md => README-ar.md (95%) diff --git a/README.md b/README-ar.md similarity index 95% rename from README.md rename to README-ar.md index 5da1808..d6fd4c8 100644 --- a/README.md +++ b/README-ar.md @@ -4,17 +4,18 @@

-# مترجم brainfu* k: مترجم بسيط من Brainfuc * K و REPL مكتوب في Rust 🦀 - -## سمات -- قم بتشغيل كود brainfu * k من ملف 💫 -- قم يسمح Brainfu * k الكود المباشر من REPL 🚀 +# ممترجم بسيط وREPL للغة brainfu*k مكتوب باللغة Rust🦀 +#### *اقرأ هذا في لغات أخرى.* +[EN English](translations/README.md) +## المميزات +- تشغيل التعليمات البرمجية brainfuc * k من ملف 💫 +- تشغيل brainfuc * k رمز مباشر من REPL🚀 - دعم أحرف UTF-8 بما في ذلك الرموز التعبيرية 😍 (اختياري) - يمكنك التحكم في حجم المصفوفة 📏 ## تثبيت -- تثبيت crates.io: +- من crates.io: ```shell cargo install bfy ``` From d5812f638323dc5dcd5ab923e98aec55703c42a2 Mon Sep 17 00:00:00 2001 From: Idris Musa Date: Sat, 15 Oct 2022 20:13:34 +0100 Subject: [PATCH 3/7] Add files via upload --- README.md | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..4305653 --- /dev/null +++ b/README.md @@ -0,0 +1,197 @@ +

+ +brainfuc*k interpreter + +

+ +# brainfuc*k interpreter: a simple brainfuc*k interpreter and REPL writen in rust 🦀 + +## Features +- Run brainfuc*k code from a file 💫 +- Run brainfuc*k live code from the REPL 🚀 +- Support utf-8 characters including emojis 😍 (optional) +- You can control in the array size 📏 + +## Install + +- from crates.io + ```shell + cargo install bfy + ``` +- From aur: + ```shell + yay -S bfy + ``` + +## Options and arguments +
+ Options table +
OptionDescriptionDefaultاختياروصفإفتراضي
-h, --helpPrints help informationطباعة معلومات المساعدة
-V, --versionPrints version informationيطبع معلومات الإصدار
-f, --features - The extra features to enable
- Possible values: + الميزات الإضافية للتمكين
+ القيم الممكنة:
  • no-reverse-value:
    - If the value is you want decrement the value and the value is 0, don't set the value to 255, otherwise decrement the value.
    - If the value is you want increment the value and the value is 255, don't set the value to 0, otherwise increment the value. The alias are: - `nrv` + إذا كانت القيمة تريد إنقاص القيمة وكانت القيمة 0 ، فلا تعين القيمة على 255 ، وإلا قلل القيمة.
    + إذا كانت القيمة تريد زيادة القيمة وكانت القيمة 255 ، فلا تقم بتعيين القيمة على 0 ، وإلا قم بزيادة القيمة. الاسم المستعار هو: + "nrv"
  • reverse-pointer:
    - If the pointer at the end of the array, set the pointer to 0, otherwise increment the pointer.
    - If the pointer at the beginning of the array, set the pointer to the end of the array, otherwise decrement the pointer. The alias are: `rp` + إذا كان المؤشر في نهاية المصفوفة ، فاضبط المؤشر على 0 ، وإلا قم بزيادة المؤشر.
    + إذا كان المؤشر في بداية المصفوفة ، فاضبط المؤشر على نهاية المصفوفة ، وإلا قلل المؤشر. الاسم المستعار هو: `rp`
  • allow-utf8:
    - Allow the use of utf8 characters (32 bit), otherwise only 8 bit characters are allowed.
    - Use this feature with caution because it increases the cell size from 8 bits to 32 bits.
    - It also allow you to use the emoji in your brainfuck code :D, This is if you can - preserve your mind so that you can access their digital value :).
    - The `u32` in rust can only store values from 0 to 4294967295, but we - can only use 0 to 1114111 (0x10FFFF) for now. The alias are: `utf8` + اسمح باستخدام أحرف utf8 (32 بت) ، وإلا فلن يُسمح إلا باستخدام أحرف 8 بت.
    + استخدم هذه الميزة بحذر لأنها تزيد حجم الخلية من 8 بت إلى 32 بت.
    + كما يسمح لك باستخدام الرموز التعبيرية في كود مخادعك: D ، هذا إذا استطعت + حافظ على عقلك حتى تتمكن من الوصول إلى قيمتها الرقمية :).
    + يمكن لـ "u32" في الصدأ تخزين القيم من 0 إلى 4294967295 فقط ، لكننا + يمكن فقط استخدام 0 إلى 1114111 (0x10FFFF) في الوقت الحالي. الاسم المستعار هو: `utf8`
n/aغير متوفر
-a, --array-sizeThe size of the arrayحجم المصفوفة 30000
-w, --without-tilesDont print the tiles (e.g. exit code, file name, etc)لا تقم بطباعة المربعات (مثل رمز الخروج واسم الملف وما إلى ذلك)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescriptionDefault
-h, --helpPrints help information
-V, --versionPrints version information
-f, --features + The extra features to enable
+ Possible values: +
    +
  • no-reverse-value:
    + If the value is you want decrement the value and the value is 0, don't set the value to 255, otherwise decrement the value.
    + If the value is you want increment the value and the value is 255, don't set the value to 0, otherwise increment the value. The alias are: + `nrv` +
  • +
  • reverse-pointer:
    + If the pointer at the end of the array, set the pointer to 0, otherwise increment the pointer.
    + If the pointer at the beginning of the array, set the pointer to the end of the array, otherwise decrement the pointer. The alias are: `rp` +
  • +
  • allow-utf8:
    + Allow the use of utf8 characters (32 bit), otherwise only 8 bit characters are allowed.
    + Use this feature with caution because it increases the cell size from 8 bits to 32 bits.
    + It also allow you to use the emoji in your brainfuck code :D, This is if you can + preserve your mind so that you can access their digital value :).
    + The `u32` in rust can only store values from 0 to 4294967295, but we + can only use 0 to 1114111 (0x10FFFF) for now. The alias are: `utf8` +
  • +
+
n/a
-a, --array-sizeThe size of the array30000
-w, --without-tilesDont print the tiles (e.g. exit code, file name, etc)
+
+ + +
+Help option output + +```shell +bfy --help +``` +```text +Brainfu*k interpreter and REPL written in Rust + +Usage: bfy [OPTIONS] [SOURCE] + +Arguments: + [SOURCE] + The brainfuck source code file to run (if not will be entered in REPL mode) + +Options: + -f, --features + Possible values: + - no-reverse-value: + If the value is you want decrement the value and the value is 0, don't set the value to 255, otherwise decrement the value. If the + value is you want increment the value and the value is 255, don't set the value to 0, otherwise increment the value. The alias are: + `nrv` + - reverse-pointer: + If the pointer at the end of the array, set the pointer to 0, otherwise increment the pointer. If the pointer at the beginning of the + array, set the pointer to the end of the array, otherwise decrement the pointer. The alias are: `rp` + - allow-utf8: + Allow the use of utf8 characters (32 bit), otherwise only 8 bit characters are allowed. Use this feature with caution because it + increases the cell size from 8 bits to 32 bits. It also allow you to use the emoji in your brainfuck code :D, This is if you can + preserve your mind so that you can access their digital value :). The `u32` in rust can only store values from 0 to 4294967295, but we + can only use 0 to 1114111 (0x10FFFF) for now. The alias are: `utf8` + + -a, --array-size + The brainfuck array size + + [default: 30000] + + -w, --without-tiles + Dont print the tiles (e.g. exit code, file name, etc) + + -h, --help + Print help information (use `-h` for a summary) + + -V, --version + Print version information +``` + +
+ +### Examples + +```bash +bfy test_code/hello_world.bf +``` +```text +Hello world! +Successfully ran brainfuck source code from file: test_code/hello_world.bf +Exiting with code: 0 +``` + +```bash +bfy -w test_code/hello_world.bf +``` +```text +Hello world! +``` + +```bash +bfy test_code/print_hi_yooo.bf +``` +```text +Hi yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo!Successfully ran brainfuck source code from file: test_code/print_hi_yooo.bf +Exiting with code: 0 +``` + +```bash +bfy -w test_code/print_hi_yooo.bf +``` +```text +Hi yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! +``` + +```bash +bfy test_code/like_cat.bf +``` +![output](./screenshots/like_cat_output.png) +> Note: The output is not the same as the current version of the interpreter, but it is the same as the output of the interpreter when I wrote the code. + +## REPL +```bash +bfy # REPL mode +``` +![print @ and A in the repl](./screenshots/repl_print_at_and_A_0.1.0.png) + +## TODO +- [ ] Add more tests +- [ ] Add more examples +- [ ] Create the brainfuck formatter +- [ ] Add syntax highlighting in the REPL +- [ ] Add auto completion in the REPL +- [ ] Support dynamic array size feature + +## Resources +- [Brainfuck in wikipedia](https://en.wikipedia.org/wiki/Brainfuck) +- [Programming in Brainfuck](http://cydathria.com/bf/brainfuck.html) +- [Brainfuck: An Eight-Instruction Turing-Complete Programming Language](http://www.muppetlabs.com/~breadbox/bf) +- [brainfuck-visualizer](https://github.com/usaikiran/brainfuck-visualizer) +- [Basics of BrainFuck](https://gist.github.com/roachhd/dce54bec8ba55fb17d3a) +- [An elegant programming language: Brainfuck](https://www.neperos.com/article/raqehg6b24ceadba) \ No newline at end of file From a0a7c7ce7a552952f79cd54aef19f3037fab447f Mon Sep 17 00:00:00 2001 From: Idris Musa Date: Sat, 15 Oct 2022 20:15:30 +0100 Subject: [PATCH 4/7] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4305653..23493bc 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@

# brainfuc*k interpreter: a simple brainfuc*k interpreter and REPL writen in rust 🦀 +#### *Read this in other languages.* + +[AR Arabic-العربية](translations/README-ar.md) ## Features - Run brainfuc*k code from a file 💫 @@ -194,4 +197,4 @@ bfy # REPL mode - [Brainfuck: An Eight-Instruction Turing-Complete Programming Language](http://www.muppetlabs.com/~breadbox/bf) - [brainfuck-visualizer](https://github.com/usaikiran/brainfuck-visualizer) - [Basics of BrainFuck](https://gist.github.com/roachhd/dce54bec8ba55fb17d3a) -- [An elegant programming language: Brainfuck](https://www.neperos.com/article/raqehg6b24ceadba) \ No newline at end of file +- [An elegant programming language: Brainfuck](https://www.neperos.com/article/raqehg6b24ceadba) From 2a19d38f8a86c13e02467ef3eef9fa3a85c6bd03 Mon Sep 17 00:00:00 2001 From: Idris Musa Date: Sat, 15 Oct 2022 20:16:28 +0100 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 23493bc..ac3aa4f 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ # brainfuc*k interpreter: a simple brainfuc*k interpreter and REPL writen in rust 🦀 #### *Read this in other languages.* -[AR Arabic-العربية](translations/README-ar.md) +[AR Arabic-العربية](README-ar.md) ## Features - Run brainfuc*k code from a file 💫 From 2da9c144d72b1fdb7ee0acc44387ffb3b14f4bcc Mon Sep 17 00:00:00 2001 From: Idris Musa Date: Sat, 15 Oct 2022 20:18:06 +0100 Subject: [PATCH 6/7] Update README-ar.md --- README-ar.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README-ar.md b/README-ar.md index d6fd4c8..912ec58 100644 --- a/README-ar.md +++ b/README-ar.md @@ -6,9 +6,9 @@ # ممترجم بسيط وREPL للغة brainfu*k مكتوب باللغة Rust🦀 #### *اقرأ هذا في لغات أخرى.* -[EN English](translations/README.md) +[EN English](README.md) ## المميزات -- تشغيل التعليمات البرمجية brainfuc * k من ملف 💫 +-مترجم بسيط وREPL للغة brainfu*k مكتوب باللغة Rust 💫 - تشغيل brainfuc * k رمز مباشر من REPL🚀 - دعم أحرف UTF-8 بما في ذلك الرموز التعبيرية 😍 (اختياري) - يمكنك التحكم في حجم المصفوفة 📏 From 33d7fbae74f749b11a6cdaceaf436273a8ac3add Mon Sep 17 00:00:00 2001 From: Idris Musa Date: Sat, 15 Oct 2022 21:13:22 +0100 Subject: [PATCH 7/7] Update README-ar.md --- README-ar.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README-ar.md b/README-ar.md index 912ec58..97244df 100644 --- a/README-ar.md +++ b/README-ar.md @@ -190,9 +190,9 @@ bfy # REPL mode - [ ] دعم ميزة حجم الصفيف الديناميكي ## مصادر -- [مخنث فى ويكيبيديا](https://en.wikipedia.org/wiki/Brainfuck) -- [البرمجة في Brainfuck](http://cydathria.com/bf/brainfuck.html) -- [Brainfuck: لغة برمجة Turing-Complete ذات ثمانية تعليمات](http://www.muppetlabs.com/~breadbox/bf) -- [Brainfuc * k- متخيل](https://github.com/usaikiran/brainfuck-visualizer) -- [أساسيات BrainFuck](https://gist.github.com/roachhd/dce54bec8ba55fb17d3a) -- [لغة برمجة أنيقة: Brainfuck](https://www.neperos.com/article/raqehg6b24ceadba) +- [Brainfuck in Wikipedia](https://en.wikipedia.org/wiki/Brainfuck) +- [Programming in Brainfuck](http://cydathria.com/bf/brainfuck.html) +- [Brainfuck: An Eight-Instruction Turing-Complete Programming Language](http://www.muppetlabs.com/~breadbox/bf) +- [brainfuck-visualizer](https://github.com/usaikiran/brainfuck-visualizer) +- [Basics of BrainFuck](https://gist.github.com/roachhd/dce54bec8ba55fb17d3a) +- [An elegant programming language: Brainfuck](https://www.neperos.com/article/raqehg6b24ceadba)