A word count based Esoteric Programming Language based on logic of BrainFuck
Project description
Syntax
WordCount | brainfuck | description |
---|---|---|
5 |
+ | increment the byte at cell location pointer |
6 |
- | decrement the byte at cell location pointer |
7 |
[ | if pointer is zero, jump to code after matching 8 |
8 |
] | if pointer is nonzero, jump to code after matching 7 |
9 |
> | increment the data cell location pointer |
10 |
< | decrement the data cell location pointer |
11 |
, | input of one byte into cell location pointer |
12 |
. | output the byte at cell location pointer |
Installation
Beta :
git clone https://github.com/Saket-Upadhyay/WriterScript.git
cd WriterScript/WriterScript/
python3 setup.py install
File Extention
WriterScript works with .pen
or .txt
formats (UTF-8)
Usage
Execute Code (CLI):
wscript -e -s file.pen
Convert BrainFuck to WriterScript:
wscript -g -sbf sourcebrainfuckfile.txt -stxt templateTextFile.txt
How to Create WriterScript code from any text source
Step 1 : Copy the source to a text file
Step 2 : Replace the following elements with null -
, -> null
. -> null
r'\n' ->null
r'\[([a-z])*|([0-9])*\]' -> null
For Data from WikiPedia :
Remove all [0-9] index by replacing r'\[[0-9][0-9]\]'
with null
.
and all [a-z] index by replacing r'\[[a-z][a-z]\]'
with null
.
For Example
A programming language is a notation for writing programs, which are specifications of a computation or algorithm.[3] Some authors restrict the term "programming language" to those languages that can express all possible algorithms.[3][4] Traits often considered important for what constitutes a programming language include:
Function and target
A computer programming language is a language used to write computer programs, which involves a computer performing some kind of computation[5] or algorithm and possibly control external devices such as printers, disk drives, robots,
[6] and so on. For example, PostScript programs are frequently created by another program to control a computer printer or display.
More generally, a programming language may describe computation on some, possibly abstract, machine. It is generally accepted that a complete specification for a programming language includes a description, possibly idealized, of a machine or processor for that language.
[7] In most practical contexts, a programming language involves a computer;
consequently, programming languages are usually defined and studied this way.
[8] Programming languages differ from natural languages in that natural languages are only used for interaction between people, while programming languages also allow humans to communicate instructions to machines.
Becomes ->
A programming language is a notation for writing programs which are specifications of a computation or algorithm Some authors restrict the term "programming language" to those languages that can express all possible algorithms Traits often considered important for what constitutes a programming language include: Function and target A computer programming language is a language used to write computer programs which involves a computer performing some kind of computation or algorithm and possibly control external devices such as printers disk drives robots and so on For example PostScript programs are frequently created by another program to control a computer printer or display More generally a programming language may describe computation on some possibly abstract machine It is generally accepted that a complete specification for a programming language includes a description possibly idealized of a machine or processor for that language In most practical contexts a programming language involves a computer; consequently programming languages are usually defined and studied this way Programming languages differ from natural languages in that natural languages are only used for interaction between people while programming languages also allow humans to communicate instructions to machines
Step 3 : Save with .txt
extention.
Step 4 : Save your BrainFuck oneliner
code as .txt
Step 5 : Run wscript -g -sbf brainfuckfile.txt -stxt textfile.txt
Step 6 : out.pen
file will be created
Test : To test the code run wscript -e -s out.pen
Note
I created this project to help myself learn
Theory of Computation and Compiler Design
(5th Semester Course), This project is just for fun and is not associated with any person, organization (academic or non-academic) whatsoever. The project is under MIT license, so it can be used as a teaching resource, other projects, etc. with proper citation to this repository.
Check https://github.com/Saket-Upadhyay/WriterScript for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file writerscript-0.4.0.tar.gz
.
File metadata
- Download URL: writerscript-0.4.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c365054fc3b4e80c417d68ee18cf449dd7a46c684574f5816934fe81f6157485 |
|
MD5 | d876708b557b8aff8190d8f99b7f7662 |
|
BLAKE2b-256 | 94156af759fe5cbf931ec9103e972468fdbf93322e62d47815ff868e1f9df392 |
File details
Details for the file writerscript-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: writerscript-0.4.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83e30f72e2240fc8816ae8d863a7f1cecea1d9c719fc4863e019c95cfa657220 |
|
MD5 | d7312006867ecc542c2f9e0b57091bb6 |
|
BLAKE2b-256 | 4b5ebc2af1b8b3684effe46e6b7c081e1a7fd94ca79dde91d876ce78d2773a8c |