( Problems, page 163 )

: stars   ?dup if 0 do 42 emit loop then ;

: box   cr  0 do dup stars cr loop  drop ;

: \stars   cr  0 do i spaces  10 stars  cr loop ;

: /stars   dup cr  0 do dup i - 1- spaces  10 stars  cr loop ;

: /stars   begin cr dup 1- spaces  10 stars  1- dup 0= until ;


: upside-down-triangle   0 9 do  cr i 10 - abs spaces  i 2* 1+ stars  -1 +loop ;

: triangle   10 0 do  cr i 10 - abs spaces  i 2* 1+ stars  loop ;

: diamond   triangle  upside-down-triangle ;

: diamonds   0 do diamond loop quit ;


: **   ( base exponent -- exponential-value )
  over >r
  1 do j * loop r> drop ;
