+
+\ ============================== 3.9 =========================================
+\ Assignment: Write colon definitions for nip, tuck, negate, and /mod in terms
+\ of other Forth words, and check if they work (hint: test your tests on the
+\ originals first). Don't let the `redefined'-Messages spook you, they are
+\ just warnings.
+
+: nip ( a b -- b ) swap drop ;
+: tuck ( a b -- b a b ) swap over ;
+: negate ( a -- -a ) -1 * ;
+: /mod 2dup mod rot rot / ;
+
+\ ============================== 3.15 ========================================
+\ Assignment: Rewrite your definitions until now with locals
+: nip { a b } b ;
+: tuck { a b } b a b ;
+: /mod { a b } a b mod a b / ;
+
+\ ============================== 3.16 ========================================
+\ Assignment: Write min without else-part (hint: what's the definition of nip?).
+: min ( n1 n2 -- n )
+ 2dup < if swap then nip ;
+
+\ ============================== 3.17 ========================================
+\ Assignment: Write min without if.
+: min ( n1 n2 -- n ) 2dup < dup
+ 2swap ( v v n1 n2)
+ rot ( v n1 n2 v )
+ invert and ( v n1 n2v )
+ rot rot and ( n2v n1v )
+ or ( n ) ;
+
+\ ============================== 3.18 ========================================
+\ Assignment: Write a definition for computing the greatest common divisor.
+: gcd ( a b -- x )
+ begin
+ 2dup mod ( a b r )
+ rot drop ( b r -> a b in next step )
+ dup 0=
+ until drop ;
+
+
+\ ============================== 3.19 ========================================
+\ Assignment: Write a definition for computing the nth Fibonacci number.
+
+: fibit ( n -- fib (n)
+ 0 1 ( u v -- initial values )
+ rot 0 u+do
+ 2dup + ( u_old u_new v_new )
+ rot drop ( u_new v_new )
+ loop nip ;
+
+\ ============================== 3.20 ========================================
+\ Assignment: Write a recursive definition for computing the nth Fibonacci
+\ number.
+: fibrec ( n -- fib (n)
+ dup 1 > if dup 1- recurse swap 2 - recurse +
+ else dup 0= if drop 1 then then ;
+
+: show20fib cr 20 0 u+do i dup dup . ." : " fibit . ." , " fibrec . cr loop ;
+
+\ TODO
+\ ============================== 3.22 ========================================
+\ ============================== 3.23 ========================================