Giter VIP home page Giter VIP logo

lost's Introduction

Lost

Lost is a 2 dimensional language in which the start location and direction are entirely random

Memory

The memory is stored in a stack and a scope. Both are stacks padded with zeros at the bottom. At the end of execution the contents of the stack are printed.

Unlike most 2D languages the ip may start in any location moving in any direction. When the ip reaches an edge it will wrap to the other side (like a torus).

Commands

Mirrors

  • \ Swaps the x and y directions

  • / Swaps the x and y directions and multiplies them by -1

  • | Multiplies the horizontal direction by -1

Directions

  • > Tells the ip to move east

  • < Tells the ip to move west

  • v Tells the ip to move south

  • ^ Tells the ip to move north

Doors

  • [ Reflects the ip if it is moving east; becomes ] if the ip is moving horizontally

  • ] Reflects the ip if it is moving west; becomes [ if the ip is moving horizontally

Jumps

  • ! Skips the next operation

  • ? Pops off the top of the stack and jumps if not zero

Stack manipulation

  • : Duplicates the top of the stack

  • $ Swaps the top two items of the stack

  • ( Pops from the stack and pushes to the scope

  • ) Pops from the scope and pushes to the stack

Literals

  • 0-9 pushes n to the top of the stack

  • " Starts and ends a string literal. During a string literal commands are not run and instead their character values are pushed to the stack.

Operations

  • + Adds the top two numbers

  • * Multiplies the top two numbers

  • - Multiplies the top by -1

Control

  • % Turns the safety off

  • # Turns the safety on

  • @ Ends execution if the safety is off (starts on)

lost's People

Contributors

detly avatar wheatwizard avatar

Stargazers

 avatar Christopher Gadzinski avatar ebigram avatar Adam Soutar avatar ik5 avatar Hannah Lazarus avatar Sarah avatar Jacob Allen avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

detly

lost's Issues

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.