Commit 151bdc83 authored by Jim Blandy's avatar Jim Blandy
Browse files

*** empty log message ***

parent 0b0ef30f
...@@ -245,15 +245,15 @@ configuration, and other parameters set as specified in CONFIGURATION." ...@@ -245,15 +245,15 @@ configuration, and other parameters set as specified in CONFIGURATION."
;;;; Convenience functions for accessing and interactively changing ;;;; Convenience functions for accessing and interactively changing
;;;; frame parameters. ;;;; frame parameters.
(defun frame-width (&optional frame) (defun frame-height (&optional frame)
"Return number of lines available for display on FRAME. "Return number of lines available for display on FRAME.
If FRAME is omitted, describe the currently selected frame." If FRAME is omitted, describe the currently selected frame."
(cdr (assq 'width (frame-parameters frame)))) (cdr (assq 'height (frame-parameters frame))))
(defun frame-width (&optional frame) (defun frame-width (&optional frame)
"Return number of columns available for display on FRAME. "Return number of columns available for display on FRAME.
If FRAME is omitted, describe the currently selected frame." If FRAME is omitted, describe the currently selected frame."
(cdr (assq 'height (frame-parameters frame)))) (cdr (assq 'width (frame-parameters frame))))
(defun set-frame-height (h) (defun set-frame-height (h)
(interactive "NHeight: ") (interactive "NHeight: ")
......
...@@ -81,27 +81,20 @@ ...@@ -81,27 +81,20 @@
(define-key blackbox-mode-map "\C-e" 'bb-eol) (define-key blackbox-mode-map "\C-e" 'bb-eol)
(define-key blackbox-mode-map "\C-a" 'bb-bol) (define-key blackbox-mode-map "\C-a" 'bb-bol)
(define-key blackbox-mode-map " " 'bb-romp) (define-key blackbox-mode-map " " 'bb-romp)
(define-key blackbox-mode-map [insert] 'bb-romp)
(define-key blackbox-mode-map "\C-m" 'bb-done) (define-key blackbox-mode-map "\C-m" 'bb-done)
(define-key blackbox-mode-map [kp-enter] 'bb-done)
;; This is a kluge. What we really want is a general ;; This is a kluge. What we really want is a general
;; feature for reminding terminal keys to the functions ;; feature for reminding terminal keys to the functions
;; corresponding to them in local maps ;; corresponding to them in local maps.
(if (featurep 'keypad) (mapcar (function
(let (keys) (lambda (funk)
(if (setq keys (function-key-sequence ?u)) ; Up Arrow (mapcar (function
(define-key blackbox-mode-map keys 'bb-up)) (lambda (key)
(if (setq keys (function-key-sequence ?d)) ; Down Arrow (define-key blackbox-mode-map key funk)))
(define-key blackbox-mode-map keys 'bb-down)) (where-is-internal funk))))
(if (setq keys (function-key-sequence ?l)) ; Left Arrow '(previous-line next-line backward-character forward-character)))
(define-key blackbox-mode-map keys 'bb-left))
(if (setq keys (function-key-sequence ?r)) ; Right Arrow
(define-key blackbox-mode-map keys 'bb-right))
(if (setq keys (function-key-sequence ?e)) ; Enter
(define-key blackbox-mode-map keys 'bb-done))
(if (setq keys (function-key-sequence ?I)) ; Insert
(define-key blackbox-mode-map keys 'bb-romp))
)))
;; Blackbox mode is suitable only for specially formatted data. ;; Blackbox mode is suitable only for specially formatted data.
(put 'blackbox-mode 'mode-class 'special) (put 'blackbox-mode 'mode-class 'special)
...@@ -139,9 +132,10 @@ your score. ...@@ -139,9 +132,10 @@ your score.
Overview of play: Overview of play:
To play blackbox, call the function `blackbox'. An optional prefix \\<blackbox-mode-map>\
argument specifies the number of balls to be hidden in the box; the To play blackbox, type \\[blackbox]. An optional prefix argument
default is four. specifies the number of balls to be hidden in the box; the default is
four.
The cursor can be moved around the box with the standard cursor The cursor can be moved around the box with the standard cursor
movement keys. movement keys.
...@@ -150,14 +144,14 @@ To shoot a ray, move the cursor to the edge of the box and press SPC. ...@@ -150,14 +144,14 @@ To shoot a ray, move the cursor to the edge of the box and press SPC.
The result will be determined and the playfield updated. The result will be determined and the playfield updated.
You may place or remove balls in the box by moving the cursor into the You may place or remove balls in the box by moving the cursor into the
box and pressing \\<bb-romp>. box and pressing \\[bb-romp].
When you think the configuration of balls you have placed is correct, When you think the configuration of balls you have placed is correct,
press \\<bb-done>. You will be informed whether you are correct or not, and press \\[bb-done]. You will be informed whether you are correct or
be given your score. Your score is the number of letters and numbers not, and be given your score. Your score is the number of letters and
around the outside of the box plus five for each incorrectly placed numbers around the outside of the box plus five for each incorrectly
ball. If you placed any balls incorrectly, they will be indicated placed ball. If you placed any balls incorrectly, they will be
with `x', and their actual positions indicated with `o'. indicated with `x', and their actual positions indicated with `o'.
Details: Details:
...@@ -408,7 +402,8 @@ a reflection." ...@@ -408,7 +402,8 @@ a reflection."
(bb-update-board c) (bb-update-board c)
(1+ (bb-show-bogus-balls-2 (cdr list-1) list-2 c))))) (1+ (bb-show-bogus-balls-2 (cdr list-1) list-2 c)))))
;; blackbox.el ends here (defun bb-outside-box (x y)
(or (= x -1) (= x 8) (= y -1) (= y 8)))
(defun bb-goto (pos) (defun bb-goto (pos)
(goto-char (+ (* (car pos) 2) (* (cdr pos) 22) 26))) (goto-char (+ (* (car pos) 2) (* (cdr pos) 22) 26)))
......
...@@ -1049,8 +1049,10 @@ isfloat_string (cp) ...@@ -1049,8 +1049,10 @@ isfloat_string (cp)
} }
return (*cp == 0 return (*cp == 0
&& (state == (LEAD_INT|DOT_CHAR|TRAIL_INT) && (state == (LEAD_INT|DOT_CHAR|TRAIL_INT)
|| state == (DOT_CHAR|TRAIL_INT)
|| state == (LEAD_INT|E_CHAR|EXP_INT) || state == (LEAD_INT|E_CHAR|EXP_INT)
|| state == (LEAD_INT|DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT))); || state == (LEAD_INT|DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT)
|| state == (DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT)));
} }
#endif /* LISP_FLOAT_TYPE */ #endif /* LISP_FLOAT_TYPE */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment