mkmcc / jumblr Goto Github PK
View Code? Open in Web Editor NEWan anagram game for emacs
License: GNU General Public License v3.0
an anagram game for emacs
License: GNU General Public License v3.0
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.