«前の日記(2005.05.10 / Tuesday) 最新 次の日記(2005.05.13 / Friday)» 編集

Hena Hena Nikki

2003|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|10|11|12|
2012|01|02|03|04|05|06|07|08|10|12|
2013|01|02|04|06|

2005.05.12 / Thursday [長年日記]

* [computer/update] Mozilla Firefox 1.0.4

標準的な選択肢になりつつある multi platform な web browser。 約 1 ヶ月ぶりの version up。

* [computer/update] Mozilla Suite 1.7.8

multi-platform な MUA 付き web browser。 約 1 ヶ月ぶりの version up。

* [computer/update] 鬼車 ver.3.8.1

複数の文字コードに対応した C の正規表現ライブラリ (BSD ライセンス)。 約 1 ヶ月ぶりの version up。

* [computer] 第44回 言語・音声理解と対話処理研究会

6/3 に京都工繊大で開かれる研究集会。 行きます。

今朝のメールでは「まだプログラムを組めてない」という話だったけど、なんかちゃんと決まってる。 素早いなぁ。

この研究集会の前の週にある東京工科大学への出張の翌日 (5/28) は、 久々に横田さんにお会いできる模様。 1 年半ぶりかな。 ちなみに bg66 さんは約 1 年ぶり、gony さんは約半年ぶりか。

* [computer] 再帰のお勉強をやってみる (8 クイーン: ボードの準備)

今日はちょっと元気が残ってるので。

(defvar ys:8queen-board-data nil "チェス盤を示す変数")
(defconst ys:8queen-board-width 8 "チェス盤の幅")
(defconst ys:8queen-board-height 8 "チェス盤の高さ")
(defun ys:8queen-init-board () "チェス盤の初期化" (setq ys:8queen-board-data nil) (let ((index 0) (size (* ys:8queen-board-width ys:8queen-board-height))) (while (< index size) (setq ys:8queen-board-data (cons nil ys:8queen-board-data) index (1+ index)))))
(defun ys:8queen-put-queen (x y) "チェス盤にクイーンを置く" (if (and (< x ys:8queen-board-width) (< y ys:8queen-board-height)) (let (new-list pieces (position (+ x (* y ys:8queen-board-width))) (index 0) (size (* ys:8queen-board-width ys:8queen-board-height))) (while (< index size) (setq pieces (if (= index position) t (nth index ys:8queen-board-data))) (setq new-list (cons pieces new-list) index (1+ index))) (setq ys:8queen-board-data (reverse new-list))) (error "盤の外にクイーンを置くつもり?")))
(defun ys:8queen-remove-queen (x y) "チェス盤からクイーンをどかす" (if (and (< x ys:8queen-board-width) (< y ys:8queen-board-height)) (let (new-list pieces (position (+ x (* y ys:8queen-board-width))) (index 0) (size (* ys:8queen-board-width ys:8queen-board-height))) (while (< index size) (setq pieces (if (= index position) nil (nth index ys:8queen-board-data))) (setq new-list (cons pieces new-list) index (1+ index))) (setq ys:8queen-board-data (reverse new-list))) (error "盤の外にクイーンを置いたつもり?")))
(defun ys:8queen-display-board () "チェス盤を表示する" (let ((buf (get-buffer-create " *8queen-board*")) (x 0) (width (1- ys:8queen-board-width)) (y 0) (height (1- ys:8queen-board-height))) (save-excursion (set-buffer buf) (erase-buffer) ;; 上端 (insert "┏") (while (< x width) (insert "━┳") (setq x (1+ x))) (insert "━┓\n") ;; 中 (while (< y height) (setq x 0 width ys:8queen-board-width) (insert "┃") (while (< x width) (if (nth (+ x (* y ys:8queen-board-width)) ys:8queen-board-data) (insert "●") (insert " ")) (insert "┃") (setq x (1+ x))) (insert "\n┣") (setq x 0 width (1- ys:8queen-board-width)) (while (< x width) (insert "━╋") (setq x (1+ x))) (insert "━┫\n") (setq y (1+ y))) ;; 下端 (setq x 0 width ys:8queen-board-width) (insert "┃") (while (< x width) (if (nth (+ x (* y ys:8queen-board-width)) ys:8queen-board-data) (insert "●") (insert " ")) (insert "┃") (setq x (1+ x))) (insert "\n┗") (setq x 0 width (1- ys:8queen-board-width)) (while (< x width) (insert "━┻") (setq x (1+ x))) (insert "━┛\n")) (display-buffer buf)))

修正中…。←done.

(progn
  (ys:8queen-init-board)
  (ys:8queen-display-board)
  (sit-for 1)
  (ys:8queen-put-queen 0 0)
  (ys:8queen-display-board)
  (sit-for 1)
  (ys:8queen-put-queen 0 1)
  (ys:8queen-display-board)
  (sit-for 1)
  (ys:8queen-remove-queen 0 0)
  (ys:8queen-display-board)
  (sit-for 1)
  (ys:8queen-put-queen 3 4)
  (ys:8queen-display-board))

眠くなってきたので続きはまた今度。


  • この日記には本日 名の方が訪問してくださっているようです。 また、昨日は 名の方が訪問してくださったようです。
  • この日記の更新情報の取得には antenna.lirs を利用するのがおすすめです。