\ ============================== 3.6 ========================================= \ Given: How do you get: \ 1 2 3 3 2 1 : ass36.1.1 1 2 3 rot rot swap .s 2drop drop ; \ 1 2 3 1 2 3 2 : ass36.1.2 1 2 3 over .s 2drop 2drop ; \ 1 2 3 1 2 3 3 : ass36.1.3 1 2 3 dup .s 2drop 2drop ; \ 1 2 3 1 3 3 : ass36.1.4 1 2 3 swap drop dup .s 2drop drop ; \ 1 2 3 2 1 3 : ass36.1.5 1 2 3 rot swap .s 2drop drop ; \ 1 2 3 4 4 3 2 1 : ass36.1.6 1 2 3 4 swap 2swap swap ; \ 1 2 3 1 2 3 1 2 3 \ 1 2 3 4 1 2 3 4 1 2 \ 1 2 3 \ 1 2 3 1 2 3 4 \ 1 2 3 1 3 \ Assignment: Write 17^3 and 17^4 in Forth, without writing 17 more than once. \ Write a piece of Forth code that expects two numbers on the stack (a and b, \ with b on top) and computes (a-b)(a+1). : ass36.2 17 dup dup * * ; : ass36.3 17 dup 2dup * * * ; : ass36.4 ( a b -- erg) over swap - swap 1 + * ;