Feature request: briefly flash newly guessed word in different color
Opened this issue · 1 comments
Great game, thanks for writing it!
When playing with a large list of words, I have a hard time telling if I've guessed a new word or simply retyped I word I already had. It would help to have a newly guessed word appear in a different color. I guess strictly speaking knowing I really got a new word is unnecessary, but it's reassuring.
Here's a very hacky way to implement the change: when a correct guess is made, instead of putting (word t)
in the data structure, mark it differently, say as (word new)
, then when drawing that entry use a different face and change the symbol new
to t
so on the next redrawing it will appear in jlr-correct-face
. Here's a diff:
diff -c your-jumblr.el modified-jumblr.el
*** your-jumblr.el 2015-01-09 11:15:37.899773390 -0500
--- modified-jumblr.el 2015-01-09 11:00:49.907370068 -0500
***************
*** 130,135 ****
--- 130,136 ----
;;; faces
(make-face 'jlr-scrable-face)
(make-face 'jlr-correct-face)
+ (make-face 'jlr-flash-face)
(make-face 'jlr-cheat-face)
(make-face 'jlr-blank-face)
(make-face 'jlr-guess-face)
***************
*** 140,145 ****
--- 141,152 ----
:foreground "#859900"
:height 1.5)
+ (set-face-attribute 'jlr-flash-face nil
+ :inherit 'fixed-pitch
+ :weight 'bold
+ :foreground "#008599"
+ :height 1.5)
+
(set-face-attribute 'jlr-blank-face nil
:inherit 'fixed-pitch
:height 1.5)
***************
*** 375,380 ****
--- 382,390 ----
(cond
((equal -1 status)
(propertize output 'face 'jlr-cheat-face))
+ ((equal 'new status)
+ (setcdr elt '(t))
+ (propertize output 'face 'jlr-flash-face))
(status
(propertize output 'face 'jlr-correct-face))
(t
***************
*** 428,434 ****
(when (-contains? data try)
(let ((ind (-elem-index try data)))
(setq data (remove try data))
! (setq data (-insert-at ind (list word t) data))))
(setq jlr-game-data
(list (list (jlr-scramble-word scr) "")
data))))
--- 438,444 ----
(when (-contains? data try)
(let ((ind (-elem-index try data)))
(setq data (remove try data))
! (setq data (-insert-at ind (list word 'new) data))))
(setq jlr-game-data
(list (list (jlr-scramble-word scr) "")
data))))
Diff finished. Fri Jan 9 11:16:45 2015
This seems very undisciplined and I'm sure if you wanted to implement this feature you'd find a better way to do it.
hi! thanks so much for writing, and I apologize for my slow response.
this is a great idea!
i unfortunately don't have time to implement it at the moment... if you
submit your patch as a pull request, though, I'd be happy to try it out and
merge it in if it works.
thanks again!
Mike
On Fri, Jan 9, 2015 at 11:23 AM, oantolin notifications@github.com wrote:
Great game, thanks for writing it!
When playing with a large list of words, I have a hard time telling if
I've guessed a new word or simply retyped I word I already had. It would
help to have a newly guessed word appear in a different color. I guess
strictly speaking knowing I really got a new word is unnecessary, but it's
reassuring.Here's a very hacky way to implement the change: when a correct guess is
made, instead of putting (word t) in the data structure, mark it
differently, say as (word new), then when drawing that entry use a
different face and change the symbol new to t so on the next redrawing
it will appear in jlr-correct-face. Here's a diff:diff -c your-jumblr.el modified-jumblr.el
*** your-jumblr.el 2015-01-09 11:15:37.899773390 -0500
--- modified-jumblr.el 2015-01-09 11:00:49.907370068 -0500
*** 130,135 ****
--- 130,136 ----
;;; faces
(make-face 'jlr-scrable-face)
(make-face 'jlr-correct-face)
(make-face 'jlr-flash-face)
(make-face 'jlr-cheat-face)
(make-face 'jlr-blank-face)
(make-face 'jlr-guess-face)
*** 140,145 ****
--- 141,152 ----
:foreground "#859900"
:height 1.5)(set-face-attribute 'jlr-flash-face nil
:inherit 'fixed-pitch
:weight 'bold
:foreground "#008599"
:height 1.5)
(set-face-attribute 'jlr-blank-face nil
:inherit 'fixed-pitch
:height 1.5)
*** 375,380 ****
--- 382,390 ----
(cond
((equal -1 status)
(propertize output 'face 'jlr-cheat-face))((equal 'new status)
(setcdr elt '(t))
(propertize output 'face 'jlr-flash-face)) (status (propertize output 'face 'jlr-correct-face)) (t
*** 428,434 ****
(when (-contains? data try)
(let ((ind (-elem-index try data)))
(setq data (remove try data))
! (setq data (-insert-at ind (list word t) data))))
(setq jlr-game-data
(list (list (jlr-scramble-word scr) "")
data))))
--- 438,444 ----
(when (-contains? data try)
(let ((ind (-elem-index try data)))
(setq data (remove try data))
! (setq data (-insert-at ind (list word 'new) data))))
(setq jlr-game-data
(list (list (jlr-scramble-word scr) "")
data))))Diff finished. Fri Jan 9 11:16:45 2015
This seems very undisciplined and I'm sure if you wanted to implement this
feature you'd find a better way to do it.—
Reply to this email directly or view it on GitHub
#1.