Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Stack/MiniScript/stack.mini
Normal file
14
Task/Stack/MiniScript/stack.mini
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Note in Miniscript, a value of zero is false,
|
||||
// and any other number is true.
|
||||
// therefore the .len function works as the inverse of a .empty function
|
||||
stack = [2, 4, 6]
|
||||
stack.push 8
|
||||
print "Stack is " + stack
|
||||
print "Adding '9' to stack " + stack.push(9)
|
||||
print "Top of stack is " + stack.pop
|
||||
print "Stack is " + stack
|
||||
if stack.len then
|
||||
print "Stack is not empty"
|
||||
else
|
||||
print "Stack is empty"
|
||||
end if
|
||||
Loading…
Add table
Add a link
Reference in a new issue