Skip to content

Instantly share code, notes, and snippets.

@lsparrish
Created October 12, 2010 19:40
Show Gist options
  • Select an option

  • Save lsparrish/622781 to your computer and use it in GitHub Desktop.

Select an option

Save lsparrish/622781 to your computer and use it in GitHub Desktop.
chain: stacks'
{{
variable this
: stack ( -n ) this @ ;
---reveal---
: :| ( n- ) this ! ;
: |: ( "- ) create here dup :| , 100 allot ;
: \ ( n- ) stack ++ stack @ ! ;
: / ( -n ) stack @ stack -- @ ;
}}
;chain
with stacks'
|: box1
10
\
20
\
/ .s
/ .s
\
\
|: box2
30
\
40
\
/
/ .s
box1 :|
/
/
.s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment