Function: bb-trace-ray
bb-trace-ray is a byte-compiled function defined in blackbox.el.gz.
Signature
(bb-trace-ray X Y)
Source Code
;; Defined in /usr/src/emacs/lisp/play/blackbox.el.gz
(defun bb-trace-ray (x y)
(when (= (following-char) 32)
(let ((result (bb-trace-ray-2
t
x
(cond
((= x -1) 1)
((= x 8) -1)
(t 0))
y
(cond
((= y -1) 1)
((= y 8) -1)
(t 0)))))
(cond
((eq result 'hit)
(bb-update-board (propertize "H" 'help-echo "Hit"))
(setq bb-score (1+ bb-score)))
((equal result (cons x y))
(bb-update-board (propertize "R" 'help-echo "Reflection"))
(setq bb-score (1+ bb-score)))
(t
(setq bb-detour-count (1+ bb-detour-count))
(bb-update-board (propertize (format "%d" bb-detour-count)
'help-echo "Detour"))
(save-excursion
(bb-goto result)
(bb-update-board (propertize (format "%d" bb-detour-count)
'help-echo "Detour")))
(setq bb-score (+ bb-score 2)))))))