Coder Social home page Coder Social logo

stackthing1's People

Contributors

skyem123 avatar victorious3 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

stackthing1's Issues

Arrays

In this, an array will be a stack element, that can hold an arbitary amount of items of a specified type.
Interestingly / hopefully, most of the time, the array wouldn't acutally need to be poped, just editied in place most of the time.

To create these arrays, use the instruction carr (create array), and the number at the top of the stack, will be used as the number of elements. If the stack contains A, B, C, D, E then the array would be A long with B, C, D, E as the elements, with B being at 0 and E being at 3. (pops the item number and items, then pushes an array)

There will also be rarr (reverse array), which reverses an array. For example the array containting elements of B, C, D, E will be converted to E, C, D, B, with E being at 0 and B being at 3. (pops an array, then pushes a reversed array.

cbar (create blank array) will create a blank array, poping a number from the stack that specifies the length. (pops the size of the array, then pushses a blank array)

sare (set array element) will set an element in an array. on the top of the stack will be the element to put onto the array, and below that will be the index to set it at, and below that will be the array. (pops the element, index, and array, then pushes the modified array).

gare (get array element) will get an element from the array, on top of the stack should be the index, and below that should be the array. after this operation the element should be on top of the stack, with the non-modified array below it. (pops the idex and array, then pushes the element and array).

garl (get array length) will get the length of an array. (pop array, then push array, then length)

gart (get array type) will get the type of the array (pop array, then push array, then type)

darr (deconstruct array) is the opposite of carr. If the stack an array of B, C, D, E with size of A, then it would have A on the top of the stack, followed by B, C, D, E. (pop array, then push elements in array, then length of array)

also, another instruction should be added, swpm (swap many), will swap stack entries given an amount of entries to swap, similar to rarr. If the stack contains A, B, C, D, E, and A is 3, after the instruction, the stack would contain D, C, B, E.

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.