Coder Social home page Coder Social logo

pebbles's Introduction

Pebbles

Pebbles is a language with 4 pebbles and an infinite beach.

Interpretation

Pebble is read left to right with certain characters performing certain actions.

Memory

Pebble's memory is an infinte tape of ones and zeros extending in both directions.

Exactly 4 cells on the tape will be on at any point, never more, never less.

There is a read head that is always positioned between two adjacent cells

Commands

  • ] Move the read head right

  • [ Move the read head left

  • > Add the bit to the right to the output

  • < Add the bit to the left to the output

  • ~ Switch the bit to the left with the bit to the right

  • _( Begin loop, _ represents a predicate

  • ) End loop

Loops

A loop will be entered if the two bit adjacent to the read head fails to meet a predicate. A loop will be run repeatedly until the predicate is failed on a ).

Predicates

  • & performs logical and on the two bits

  • | performs logical or on the two bits

  • ^ performs logical xor on the two bits

  • !_ negates the next predicate

Running Pebbles

Currently Pebbles can be called in interactive mode using:

$ ghci Pebbles.hs

To run a program call the function pebble with the source as an argument. Example:

Prelude> pebble "[[<>"

pebbles's People

Stargazers

 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.