Pikachu interpreter written in Python
Project description
Pikachu Interpreter
This is an interpreter for Pikachu for Python 2.7.x
The definition of the esoteric programming language named 'pikachu' can be found here. This is built as a cleaner version of https://github.com/joelsmithjohnson/pikachu-interpreter.
Installation:
-
Run
$ pip install pikapy -
Go to your Sublime Packages folder, which defaults to
~/Library/Application Support/Sublime Text 3/Packageson Mac OSX andon Windows, create a new folder called Pikachu, and copy pikachu.sublime-syntax to there. -
In the same Packages folder, find
Color Scheme - Default, and copypikachu.sublime-color-schemethere. -
In Sublime Text, go to Preferences → Color Scheme, and select Pikachu.
Usage
In the command line, go to the installation directory, and run:
$ pikachu <pikachu filename> [arguments*]
Pikachu Language
In Pikachu, you have two Pikachus (i.e. stacks): pi pikachu and pika pikachu. Upon starting a Pikachu script, the arguments are pushed into pi pikachu in the order they're given.
Pikachu Syntax
Arithmetic Operations
pi pika <PIKACHU>- add the top two values in the given Pikachu, and push the sum to the same Pikachupika pi <PIKACHU>- subtract the top value in the Pikachu from the second top, then push the differencepi pikachu <PIKACHU>- multiply the top two values in the Pikachu, and push the productpikachu <PIKACHU>- divide the second-from-the-top value in the Pikachu by the top value, then push the product
Stack Operations
pika pikachu <PIKACHU>- pop the top value from the Pikachu, and print as a numberpikachu pikachu <PIKACHU>- pop the top value from the Pikachu, and print as ASCII<PIKACHU>- pop the top value from the Pikachu<n terms> <PIKACHU>- pushninto the PIkachu<pi pika>- push the top value ofpika pikachuintopi pikachu<pika pi>- push the top value ofpi pikachuintopika pikachu
Control Operations
pikachu pikachu- if the top values of both Pikachus are equal, goto linen, wherenis the number of terms in the following linepika pika- if the top values of both Pikachus are not equal, goto linen, wherenis the number of terms in the following line
Note: Pikachus start counting lines from 1, not 0
Other Options
pi pi- push topika pikachua random number between1andn, wherenis the top value inpika pikachuchu- anything that comes after achu, is treated as a comment, and will be ignored by the interpreter. This includes any line beginning with the wordchu.
Note: Things in this section are not part of the original definition of the language, rather features added for the convenience of the programming Pikachus
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pikapy-0.5-py2-none-any.whl.
File metadata
- Download URL: pikapy-0.5-py2-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b15c73a425b89ab96f9cc7dd1b39ae896aa5c174859f8b581b4a958fb96400f
|
|
| MD5 |
58c8d65bc5072b8321ee96da2303e164
|
|
| BLAKE2b-256 |
99001ceb5831d7a4f8cbbb83aec8425de46fe9c9b8e13c8c2aa56c5c1382cb26
|