skyem123 / stackthing1 Goto Github PK
View Code? Open in Web Editor NEWA stack based programming thing that I started because I was bored.
License: BSD 2-Clause "Simplified" License
A stack based programming thing that I started because I was bored.
License: BSD 2-Clause "Simplified" License
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
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.