Aurebesh

This entry is part 1 of 3 in the series Aurebesh

A few days ago, I decided to study Aurebesh. What the banana is Aurebesh? Aurebesh is a made up writing system. It appeared first in Star War’s ‘Return of the Jedi’. If you’re interested in learning more about its history, I strongly recommend you read Wookieepedia.

Jedi

The force is strong with this young Padawan

For sure, you now think I’m a major Star Wars fan. Let’s just say, I enjoy the movies and I love the books written by Drew Karpyshyn. If somebody asks me, what I prefer more, Star Trek or Star Wars, I’ll answer without hesitation Star Trek.

So why am I learning that made up writing system? First of all, it’s easy to learn. It is basically English with different letters. So I don’t actually learn a new language. You could argument that it’s useless studying those letters. Maybe, but I think it’s cool being able to read articles in Aurebesh.

I am using several links to improve my reading. I use the timed translation at least once a day to measure my progress. I’m currently at 43 characters a minute (not very impressive, I know). Additionally, I exercise reading at least 10 minutes a day with the Aurebesh trainer. Last but not least, I downloaded the font, installed it on my machine and then set Firefox’s default font to Aurebesh. I wonder how long it will take me till I can use the browser with that font setting through out the day. For now, I limit myself to one short news article a day.

This is a new day, a new beginning.

As you can see, I also got the Aurebesh font plugin for WordPress from Jeremy Duenas. Now I can add here and there a saying to my blogs and only a few people will be able to read it.

Aurebesh typing test

This entry is part 2 of 3 in the series Aurebesh

Just a bit more than a week ago, I wrote a post about me learning Aurebesh. I’m still far from proficient, but I continue practicing and, even more important, enjoying it. As mentioned in the one post, I’m using a few online tools to practice and after using Patrick Lambert’s timed translation tool for a bit, I felt like writing my own version with slight changes.

I really like Patrick’s little utility, since it gives you a nice and quick progress feedback. After using it for a bit, I could think of a few improvements. I, for example, don’t quite like that I have to press enter after each character. I consider that redundant and it makes my result count lower than it could be. Furthermore, his implementation continues with a new random character even if the user input was wrong. I prefer being stuck with an Aurebesh character till the correct input has been provided.

After writing my own little version and trying it out, I figured that it would be nice if I saw the number of wrong inputs as well. After all, a high number of correct inputs looks great, but if the number of incorrect inputs is high as well, it kind of diminishes the success.

I hope you find the little Aurebesh typing test feature useful. Please let me know if you can think of something to improve it even more.

Aurebesh typing test

Seconds left:

Correct/Wrong answers:
A(a) B(b) C(c) D(d) E(e) F(f) G(g) H(h) I(i)
J(j) K(k) L(l) M(m) N(n) O(o) P(p) Q(q) R(r)
S(s) T(t) U(u) V(v) W(w) X(x) Y(y) Z(z)

Aurebesh typing test for emacs

This entry is part 3 of 3 in the series Aurebesh

A few weeks ago, I posted the Aurebesh typing test. Since I’ve recently started learning elisp, I figured that I should implement the typing test as a feature for emacs.

The code below is terrible with bugs and problems, but heck, it’s my first elisp program after all. My goal is to improve the version over time and to add features such as logging results in a separate file and displaying a progress statistic. To use it, you’ll need to first install the Aurebesh font.

(setq correct 0)
(setq wrong 0)
(setq seconds-left 60)
(setq test-start t)

(require 'widget)

(defun aurebesh-typing-test ()
  "Aurebesh typing test"
  (interactive)
  (get-buffer-create "*Aurebesh typing test*")
  (custom/reset-aurebesh-typing-test-vars)
  (custom/aurebesh-typing-test))

(defun custom/reset-aurebesh-typing-test-vars()
  (setq test-start t)
  (setq correct 0)
  (setq wrong 0)
  (setq seconds-left 60))

(defun custom/aurebesh-typing-test()
  (with-current-buffer "*Aurebesh typing test*"
    (custom/setup-buffer)
    (custom/refresh-seconds)
    (custom/create-line-with-widget)
    (insert "Correct / wrong answers: " (number-to-string correct) " / " (number-to-string wrong) " \n")
    (custom/setup-widget)
    (custom/set-aurebesh)))

(defun custom/setup-buffer()
  (kill-all-local-variables)
  (let ((inhibit-read-only t))
    (erase-buffer))
  (remove-overlays))

(defun custom/refresh-seconds()
  (with-no-warnings
    (goto-line 1)
    (custom/delete-line)
    (insert "Seconds: " (number-to-string seconds-left) "\n")))

(defun custom/delete-line()
  (let ((beg (point)))
    (forward-line 1)
    (delete-region beg (point))))

(defun custom/create-line-with-widget()
  (if (> seconds-left 0)
      (setq randomChar (custom/get-random-char))
    (setq randomChar ""))
  (widget-insert randomChar)
  (widget-insert "\t")
  (widget-create 'editable-field
		 :size 15
		 :correct (string randomChar)
		 :notify 'custom/check-input-value)
  (widget-insert "\n"))

(defun custom/setup-widget()
  (use-local-map widget-keymap)
  (widget-setup)
  (widget-forward 1))

(defun custom/set-aurebesh()
  "Sets the aurebesh font in current buffer"
  (interactive)
  (setq buffer-face-mode-face '(:family "Aurebesh"))
  (buffer-face-mode))

(defun custom/check-input-value(widget &rest ignore)
  "Compare aurebesh input character with requested one."
  (cond
   ((string-match 
     (widget-get widget :correct)
     (widget-value widget))
    (custom/correct-input widget))
   ((not(= (length (widget-value widget)) 0))
    (custom/wrong-input))))

(defun custom/correct-input(widget)
  (if test-start
      (progn
	(custom/start-timer)
	(setq test-start nil)))
  (if (> seconds-left 0)
      (progn
	(setq correct (+ correct 1))
	(custom/next-character widget))))

(defun custom/start-timer()
  "Start Aurebesh test"
  (setq seconds-left 60)
  (setq timer (run-with-timer 0 1 'custom/decrement-seconds)))

(defun custom/decrement-seconds()
  (with-current-buffer "*Aurebesh typing test*"
    (if (> seconds-left 0)
;	(progn
	  (setq seconds-left (- seconds-left 1))
;	  (custom/refresh-seconds)
;	  (widget-forward 1))
      (custom/stop-aurebesh-typing-test))))

(defun custom/stop-aurebesh-typing-test()
  (with-current-buffer "*Aurebesh typing test*"
  (custom/refresh-seconds)
  (cancel-timer timer)
  (custom/set-arial)))

(defun custom/set-arial()
   "Sets the arial font in current buffer"
   (interactive)
   (setq buffer-face-mode-face '(:family "Arial"))
   (buffer-face-mode))

(defun custom/next-character(widget)
  (with-current-buffer "*Aurebesh typing test*"
    (custom/fill-random-character widget)
    (custom/fill-correct-wrong-answers)
    (custom/refresh-seconds)
    (widget-forward 1)
    ))

(defun custom/fill-random-character(widget)
  (with-no-warnings
    (goto-line 2))
  (delete-char 1)
  (if (> seconds-left 0)
      (setq randomChar (custom/get-random-char))
    (setq randomChar ""))
  (widget-insert randomChar)
  (widget-put widget :correct (string randomChar))
  (widget-value-set widget ""))

(defun custom/get-random-char ()
  "Insert a random alphanumeric character.."
  (let ((mycharset "abcdefghijklmnopqrstyvwxyz"))
    (elt mycharset (random (length mycharset)))))

(defun custom/fill-correct-wrong-answers()
  (with-no-warnings
    (goto-line 3))
  (kill-line)
  (insert "Correct / wrong answers: " (number-to-string correct) " / " (number-to-string wrong) " \n"))
  
(defun custom/wrong-input()
  (message "%s" (widget-get widget :correct))
  (widget-value-set widget "")
  (setq wrong (+ wrong 1)))