next up previous
Next: 9 オブジェクト指向言語の実現 Up: 8 積み木の問題 Previous: 8.2 3つの積み木の場合の評価値探索

8.3 物体モデルを用いた例


(defun init-blocks nil
  (setf (get 'a :body) (make-cube 20 20 20))
  (send (get 'a :body) :name "A")
  (setf (get (get 'a :body) :face-color) :darkred)
  (send (get 'a :body) :locate #f(100 100 0))

  (setf (get 'b :body) (make-cube 20 20 20))
  (send (get 'b :body) :name "B")
  (send (get 'b :body) :locate #f(0 100 0))
  (setf (get (get 'b :body) :face-color) :gray70)

  (setf (get 'c :body) (make-cube 20 20 20))
  (send (get 'c :body) :name "C")
  (send (get 'c :body) :locate #f(0 0 0))
  (setf (get (get 'c :body) :face-color) :gray30)
  (setq *blocks*
	(list (get 'a :body)
	      (get 'b :body)
	      (get 'c :body)))
  )
図 3: 3つのブロック A, B, C
\includegraphics[width=7cm]{/home/inaba/eps/lecture/fig/three-cubes.eps}


generated through LaTeX2HTML. M.Inaba 平成18年5月6日