A simple mathematical expression evaluator that uses Pokemon types to replace symbols.
Symbol | Math Equivalent | Pokemon Type |
---|---|---|
๐ฅ | + | Fire |
๐ | - | Water |
๐ชจ | * | Rock |
๐จ | / | Flying |
โก | // | Electric |
โ ๏ธ | % | Poison |
โ | > | Fighting |
๐ฎ | < | Psychic |
โจ | == | Normal |
๐ป | != | Ghost |
๐ง | ( | Fairy |
๐ | ) | Dark |
โ๏ธ() | abs() | Ice |
โ() | log() | Steel |
๐ฟ | | | Grass |
๐ | >= | Dragon |
๐๏ธ | <= | Ground |
๐() | ^() | Bug |
Ran out of pokemon types, need help representing:
>>>
<<<
- Numbers
- Boolean: "true" or "false"
Addition:
1 ๐ฅ 1
Subtraction:
1 ๐ 1
Checking if numbers are equal:
1 โจ 1
Is true
>= false
:
true ๐ false
For Absolute of -2
:
โ๏ธ๐ง-2๐
โ๏ธ(-2)
Using the installed python poketype
package!
Check if PokeType expression is valid
from poketype import PokeType
pt = PokeType()
pt.check_syntax('code')
Run code, and print output.
from poketype import PokeType
pt = PokeType()
print(pt.eval('code'))
Turn PokeType to python code
from poketype import PokeType
pt = PokeType()
print(pt.compile('code')) #Python
Open a PR! This is a WIP
[ ] CLI
[ ] API
[ ] More Interpreters