1.1.0 • Published 6 years ago

pipes-lang v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

PIPES

PIPES is a image-based 2D programming "language". It follows "pipes" and executes operations when reaching pipes with specific colors. Most operations work on the stack, but you can save and load from memory.

Features

  • Drawing programs
  • No more writing programs
  • Input characters
  • Output numbers and characters
  • Basic arithmetic operations
  • Comparisons
  • Saving and loading to/from memory

Planned

  • Better input processing
  • Custom palettes
  • Better debugging
  • Better editing (custom IDE?)

Install PIPES:

$ npm install pipes-lang -g

You can use this palette file for Paint.NET.

Usage

  Usage: pipes [options]

  Options:

    -V, --version       output the version number
    -d, --debug         Debug mode
    -s, --strict        Strict mode
    -i, --input [args]  Input arguments
    -p, --stepwise      NOT YET IMPLEMENTED! Stepwise execution
    -h, --help          output usage information

Pipes

The program will always try to go straight, then right and then left.

Pipes aren't allowed to touch the image borders!

This is the standard palette, in the future I want to make it easy to use custom palettes.

Meta Pipes

ColorCodeNameMeaning
White0,0,0backgroundis ignored
Black255,255,255default pipeguides program
Grey127,127,127blockadelow priority(only enters if there's no other way)
Green0,255,0entryprogram starts here
Red255,0,0exitprogram stops here

Stack Operation Pipes

ColorCodeNameMeaning
Blue0,0,255pushthe only pipe that needs an parameter afterwards, pushes the following pixel color number to the stack
Yellow255,255,0removeremoves the top element from the stack
Gray127,127,127blockadelow priority(only enters if there's no other way)
Spring Green0,255,144stack to memorysaves the second element on the stack to the adress provided by the first element, the first element is removed
Cyan0,225,255memory to stackpushes the element at the adress provided by the top element on the stack and removes the adress element
Malibu127,127,255duplicateduplicates the top element on the stack
Electric Violet178,0,255swapswaps the top two elements

Arithmetic Pipes

ColorCodeNameMeaning
Japanese Laurel37,127,0addremoves E1, E2 and pushes E1+E2
Pigment Indigo87,0,124subtractremoves E1, E2 and pushes E2-E1
Cedar Wood Finish124,24,0multiplyremoves E1, E2 and pushes E1*E2
Orient37,127,0divideremoves E1, E2 and pushes E2/E1

Control Flow Pipes

ColorCodeNameMeaning
Pumpkin Skin168,97,11comparecompares E2 to E1, and changes direction depending on the result. equal: straight, greater: right, less: left
Blue Chalk248,214,255teleport absoluteprogram jumps to position x = E2 y = E1
Baja White255,251,214teleport relativeprogram jumps on position x = x+E2 y = y+E1

I/O Pipes

ColorCodeNameMeaning
School Bus Yellow255,216,0inputno effect (yet)
Blaze Orange255,106outputremoves the top element from the stack and prints it
Chardonnay255,206,127char outputremoves the top element from the stack and prints the char with the char code provided

All the color names are only the names of the nearest named colors.

Examples

(Please tell me how I can set images to display pixelated, this is awful.)

Basic I/O

When you input "r" it will output "right", when you input "l" it will output "left, otherwise it will return "-1".

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago