Data update
This commit is contained in:
parent
52a6ef48dd
commit
157b70a810
604 changed files with 14253 additions and 2100 deletions
29
Task/Stack/FutureBasic/stack.basic
Normal file
29
Task/Stack/FutureBasic/stack.basic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
void local fn StackPush( stack as CFMutableArrayRef, obj as CFTypeRef )
|
||||
MutableArrayAddObject( stack, obj )
|
||||
end fn
|
||||
|
||||
CFTypeRef local fn StackPop( stack as CFMutableArrayRef )
|
||||
CFTypeRef obj = fn ArrayLastObject( stack )
|
||||
MutableArrayRemoveLastObject( stack )
|
||||
end fn = obj
|
||||
|
||||
BOOL def fn StackIsEmpty( stack as CFMutableArrayRef ) = len(stack) == 0
|
||||
|
||||
void local fn DoIt
|
||||
CFMutableArrayRef stack = fn MutableArrayNew
|
||||
|
||||
print @"Stack is empty: ";fn StackIsEmpty( stack )
|
||||
|
||||
print : print @"Stack push \"String\""
|
||||
fn StackPush( stack, @"String" )
|
||||
print @"Stack is empty: ";fn StackIsEmpty( stack )
|
||||
|
||||
CFTyperef obj = fn StackPop( stack )
|
||||
print : print @"Stack pop: ";obj
|
||||
|
||||
print @"Stack is empty: ";fn StackIsEmpty( stack )
|
||||
end fn
|
||||
|
||||
fn DoIt
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue