https://github.com/inokinoki/pikachu
Pikachu language based on brainfuck
https://github.com/inokinoki/pikachu
Last synced: 5 months ago
JSON representation
Pikachu language based on brainfuck
- Host: GitHub
- URL: https://github.com/inokinoki/pikachu
- Owner: Inokinoki
- Created: 2020-01-05T20:59:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-16T20:32:22.000Z (over 6 years ago)
- Last Synced: 2025-04-03T20:21:39.965Z (about 1 year ago)
- Language: Yacc
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pikachu
A programming language of the most cute pokemon based on Brainfuck.
## Introduction
Brainfuck is an esoteric programming language created in 1993 by Urban Müller, and is notable for its extreme minimalism.
For more information on it or some tutorials, please go to [Wikipedia](https://en.wikipedia.org/wiki/Brainfuck).
Here, I assume that you've mastered Brainfuck.
The pikachu programming language is just a simple variation of it:
- `pi` replaces `<`
- `ka` replaces `+`
- `chu` replaces `>`
So, as the Brainfuck language, in theory, you can write any program with it:)
But for the implementation, the "memory" is limited by 300000.
Just4fun, it's enough!
## Use
Make sure you have `flex`+`bison`/`lex`+`yacc` installed.
1. Generate token parser code with lex:
```bash
lex pikachu.l
```
You'll get `lex.yy.c`.
2. Generate grammar parser code with yacc:
```bash
yacc -d pikachu.y
```
You'll get `y.tab.c` and `y.tab.h`.
3. Compile:
```bash
gcc y.tab.c lex.yy.c -ly -o pikachu
```
4. Test:
```bash
./pikachu < test-helloworld.txt
```
You should get the output `Hello World!`.
```bash
./pikachu < test-pikachu.txt
```
You should be able to get:

## Code
Code your program on Brainfuck, transform `<` with `pi`, `>` with `chu`, `+` with `ka`, and keep the other characters not changed.
Then you master the programming language `pikachu`.