335 |
(bb-update-board (propertize "O" 'help-echo "Placed ball")))))) |
(bb-update-board (propertize "O" 'help-echo "Placed ball")))))) |
336 |
|
|
337 |
(defun bb-trace-ray (x y) |
(defun bb-trace-ray (x y) |
338 |
(let ((result (bb-trace-ray-2 |
(when (= (following-char) 32) |
339 |
t |
(let ((result (bb-trace-ray-2 |
340 |
x |
t |
341 |
(cond |
x |
342 |
((= x -1) 1) |
(cond |
343 |
((= x 8) -1) |
((= x -1) 1) |
344 |
(t 0)) |
((= x 8) -1) |
345 |
y |
(t 0)) |
346 |
(cond |
y |
347 |
((= y -1) 1) |
(cond |
348 |
((= y 8) -1) |
((= y -1) 1) |
349 |
(t 0))))) |
((= y 8) -1) |
350 |
(cond |
(t 0))))) |
351 |
((eq result 'hit) |
(cond |
352 |
(bb-update-board (propertize "H" 'help-echo "Hit")) |
((eq result 'hit) |
353 |
(setq bb-score (1+ bb-score))) |
(bb-update-board (propertize "H" 'help-echo "Hit")) |
354 |
((equal result (cons x y)) |
(setq bb-score (1+ bb-score))) |
355 |
(bb-update-board (propertize "R" 'help-echo "Reflection")) |
((equal result (cons x y)) |
356 |
(setq bb-score (1+ bb-score))) |
(bb-update-board (propertize "R" 'help-echo "Reflection")) |
357 |
(t |
(setq bb-score (1+ bb-score))) |
358 |
(setq bb-detour-count (1+ bb-detour-count)) |
(t |
359 |
(bb-update-board (propertize (format "%d" bb-detour-count) |
(setq bb-detour-count (1+ bb-detour-count)) |
360 |
'help-echo "Detour")) |
(bb-update-board (propertize (format "%d" bb-detour-count) |
361 |
(save-excursion |
'help-echo "Detour")) |
362 |
(bb-goto result) |
(save-excursion |
363 |
(bb-update-board (propertize (format "%d" bb-detour-count) |
(bb-goto result) |
364 |
'help-echo "Detour"))) |
(bb-update-board (propertize (format "%d" bb-detour-count) |
365 |
(setq bb-score (+ bb-score 2)))))) |
'help-echo "Detour"))) |
366 |
|
(setq bb-score (+ bb-score 2))))))) |
367 |
|
|
368 |
(defun bb-trace-ray-2 (first x dx y dy) |
(defun bb-trace-ray-2 (first x dx y dy) |
369 |
(cond |
(cond |