Code Monkey home page Code Monkey logo

poketype's Introduction

PokeType

A simple mathematical expression evaluator that uses Pokemon types to replace symbols.

Syntax

Reference

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

Symbols Needed

Ran out of pokemon types, need help representing: >>> <<<

Data Types

  • Numbers
  • Boolean: "true" or "false"

Examples

Basic Arithmetic

Addition:

1 ๐Ÿ”ฅ 1

Subtraction:

1 ๐ŸŒŠ 1

Comparisons/Boolean

Checking if numbers are equal:

1 โœจ 1

Is true >= false:

true ๐Ÿ‰ false

Functions

For Absolute of -2:

โ„๏ธ๐Ÿงš-2๐ŸŒŒ
โ„๏ธ(-2)

Interpreter/Compiler

Using the installed python poketype package!

Syntax Checking

Check if PokeType expression is valid

from poketype import PokeType

pt = PokeType()
pt.check_syntax('code')

Interpret

Run code, and print output.

from poketype import PokeType

pt = PokeType()
print(pt.eval('code'))

Compile

Turn PokeType to python code

from poketype import PokeType

pt = PokeType()
print(pt.compile('code')) #Python

Contributions

Open a PR! This is a WIP

[ ] CLI

[ ] API

[ ] More Interpreters

poketype's People

Contributors

daggy1234 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.