Git Product home page Git Product logo

tcode's Introduction

tCode - Turtle Instruction Language

made by Zuwel


TODO

  • ✓ - Actually functioning?
  • ✓ - Flow control (label, goto, if)
  • ✗ - Rednet communication / control
  • ✗ - Auto resume / run state saving

tCode (turtle-code) format:

  • Header

    • format (string) - the file format, which must read "tCode" for to ensure interpreter compatibility
    • version (string) - the tCode version number, used for ensuring interpreter compatibility
  • Commands

    • move (forward/up/down/back) - moves the turtle either forward, up, down, back, with an optional command repeat parameter
    • turn (left/right) - turns the turtle either left or right, with an optional command repeat parameter
    • [WIP] place (forward/up/down) - places a named block in the specified direction if possible
    • dig (false/true) - enables (true) or disables (false) the turtles ability to dig
    • suck (false/true) - enables (false) or disables (false) the turtles ability to suck
    • tooldir (front/up/down) - specifies the relative direction in which the turtle digs and sucks, forward, up, down
    • [WIP] dump - dumps all items, excluding valid fuel sources, or optionally, all of a specified item in the turtles inventory
    • [WIP] home - turtle attempts to navigate home, either by tracing back its path ()
    • [WIP] pos (x) (y) (z) - automatically tracks back to the specified position using the fastest route, using gps coordinates if possible or relative position.
    • look (north/south/east/west) - turns the turtle to face the specified rotation, using gps heading if possible or relative rotation.
    • label - a label which references a line position within the tCode file
    • goto <text, number> - skips the execution back to a specified label within the tCode file
    • if (value) (=/!=/>/</>=/<=) (value) (command) (args) - checks if the comparison is true; if so, it will run the command specified. [if commands can be chained]
    • var (set/unset/add/sub/mult/div) (name) (value) - sets user variable which can be referenced in tcode with "#"
    • print (array) - prints out a single string of parsed values to the console
    • usegps (bool) - if the turtle should use gps
    • [WIP] lowfuelreturn (bool) - if the turtle should automatically return home if it only has the fuel required (plus margin) to return home
    • [WIP] returnmethod (integer) - the method in which the turtle returns home, either by traceback (0), direct path (1), or rise and return (2)
    • [WIP] fuelmargin (integer) - amount of additional fuel saved in addition to the minimum required to return home
    • [WIP] digfilter (array) - array of blocks to consider digging (+) or not (-) ("(+/-) stone") [Warning: Could result in an automatic failure]
    • If any inclusion (+) filters are specified, it is assumed that the turtle will only dig the specified blocks [Warning: Use digfilter inclusions with caution]
    • [WIP] suckfilter (array) - array of blocks/items to consider sucking (+) or not (-) ("(+/-) diamond")
    • If any inclusion (+) filters are specified, it is assumed that the turtle will only suck the specified blocks/items
    • _ - a simple marker indicating that the header section has been read to completion
  • Rednet Commands

    • TODO

Launch Arguments: (* is required)

  • *filePath (string) - tcode text file path to read from
  • hostName (string) - host name of the wirelessly controlling computer

Usage:

##tcode filePath

tcode's People

Contributors

zuwel avatar

Watchers

 avatar

Forkers

superxwolf

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.