Mercurial > emacs
comparison lisp/play/blackbox.el @ 49598:0d8b17d428b5
Trailing whitepace deleted.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 04 Feb 2003 13:24:35 +0000 |
parents | 56e5df2ccc8d |
children | 695cf19ef79e d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
49597:e88404e8f2cf | 49598:0d8b17d428b5 |
---|---|
32 ;; The object of the game is to find four hidden balls by shooting rays | 32 ;; The object of the game is to find four hidden balls by shooting rays |
33 ;; into the black box. There are four possibilities: 1) the ray will | 33 ;; into the black box. There are four possibilities: 1) the ray will |
34 ;; pass thru the box undisturbed, 2) it will hit a ball and be absorbed, | 34 ;; pass thru the box undisturbed, 2) it will hit a ball and be absorbed, |
35 ;; 3) it will be deflected and exit the box, or 4) be deflected immediately, | 35 ;; 3) it will be deflected and exit the box, or 4) be deflected immediately, |
36 ;; not even being allowed entry into the box. | 36 ;; not even being allowed entry into the box. |
37 ;; | 37 ;; |
38 ;; The strange part is the method of deflection. It seems that rays will | 38 ;; The strange part is the method of deflection. It seems that rays will |
39 ;; not pass next to a ball, and change direction at right angles to avoid it. | 39 ;; not pass next to a ball, and change direction at right angles to avoid it. |
40 ;; | 40 ;; |
41 ;; R 3 | 41 ;; R 3 |
42 ;; 1 - - - - - - - - 1 | 42 ;; 1 - - - - - - - - 1 |
43 ;; - - - - - - - - | 43 ;; - - - - - - - - |
44 ;; - O - - - - - - 3 | 44 ;; - O - - - - - - 3 |
45 ;; 2 - - - - O - O - | 45 ;; 2 - - - - O - O - |
46 ;; 4 - - - - - - - - | 46 ;; 4 - - - - - - - - |
47 ;; 5 - - - - - - - - 5 | 47 ;; 5 - - - - - - - - 5 |
48 ;; - - - - - - - - R | 48 ;; - - - - - - - - R |
49 ;; H - - - - - - - O | 49 ;; H - - - - - - - O |
50 ;; 2 H 4 H | 50 ;; 2 H 4 H |
51 ;; | 51 ;; |
52 ;; Rays which enter and exit are numbered. You can see that rays 1 & 5 pass | 52 ;; Rays which enter and exit are numbered. You can see that rays 1 & 5 pass |
53 ;; thru the box undisturbed. Ray 2 is deflected by the northwesternmost | 53 ;; thru the box undisturbed. Ray 2 is deflected by the northwesternmost |
54 ;; ball. Likewise rays 3 and 4. Rays which hit balls and are absorbed are | 54 ;; ball. Likewise rays 3 and 4. Rays which hit balls and are absorbed are |
55 ;; marked with H. The bottom of the left and the right of the bottom hit | 55 ;; marked with H. The bottom of the left and the right of the bottom hit |
56 ;; the southeastern ball directly. Rays may also hit balls after being | 56 ;; the southeastern ball directly. Rays may also hit balls after being |
192 ray. | 192 ray. |
193 | 193 |
194 Note carefully the relative positions of the ball and the ninety | 194 Note carefully the relative positions of the ball and the ninety |
195 degree deflection it causes. | 195 degree deflection it causes. |
196 | 196 |
197 1 | 197 1 |
198 - * - - - - - - - - - - - - - - - - - - - - - - | 198 - * - - - - - - - - - - - - - - - - - - - - - - |
199 - * - - - - - - - - - - - - - - - - - - - - - - | 199 - * - - - - - - - - - - - - - - - - - - - - - - |
200 1 * * - - - - - - - - - - - - - - - O - - - - O - | 200 1 * * - - - - - - - - - - - - - - - O - - - - O - |
201 - - O - - - - - - - O - - - - - - - * * * * - - | 201 - - O - - - - - - - O - - - - - - - * * * * - - |
202 - - - - - - - - - - - * * * * * 2 3 * * * - - * - - | 202 - - - - - - - - - - - * * * * * 2 3 * * * - - * - - |
203 - - - - - - - - - - - * - - - - - - - O - * - - | 203 - - - - - - - - - - - * - - - - - - - O - * - - |
204 - - - - - - - - - - - * - - - - - - - - * * - - | 204 - - - - - - - - - - - * - - - - - - - - * * - - |
205 - - - - - - - - - - - * - - - - - - - - * - O - | 205 - - - - - - - - - - - * - - - - - - - - * - O - |
206 2 3 | 206 2 3 |
207 | 207 |
208 As mentioned above, a reflection occurs when a ray emerges from the same point | 208 As mentioned above, a reflection occurs when a ray emerges from the same point |
209 it was sent in. This can happen in several ways: | 209 it was sent in. This can happen in several ways: |
210 | 210 |
211 | 211 |
212 - - - - - - - - - - - - - - - - - - - - - - - - | 212 - - - - - - - - - - - - - - - - - - - - - - - - |
213 - - - - O - - - - - O - O - - - - - - - - - - - | 213 - - - - O - - - - - O - O - - - - - - - - - - - |
214 R * * * * - - - - - - - * - - - - O - - - - - - - | 214 R * * * * - - - - - - - * - - - - O - - - - - - - |
215 - - - - O - - - - - - * - - - - R - - - - - - - - | 215 - - - - O - - - - - - * - - - - R - - - - - - - - |
216 - - - - - - - - - - - * - - - - - - - - - - - - | 216 - - - - - - - - - - - * - - - - - - - - - - - - |
424 (let ((buffer-read-only nil)) | 424 (let ((buffer-read-only nil)) |
425 (backward-char (1- (length c))) | 425 (backward-char (1- (length c))) |
426 (delete-char (length c)) | 426 (delete-char (length c)) |
427 (insert c) | 427 (insert c) |
428 (backward-char 1))) | 428 (backward-char 1))) |
429 | 429 |
430 (provide 'blackbox) | 430 (provide 'blackbox) |
431 | 431 |
432 ;;; blackbox.el ends here | 432 ;;; blackbox.el ends here |