Author: hhubner Date: 2007-10-05 03:31:39 -0400 (Fri, 05 Oct 2007) New Revision: 2221
Modified: branches/trunk-reorg/projects/scrabble/src/make-letters.lisp branches/trunk-reorg/projects/scrabble/src/package.lisp branches/trunk-reorg/projects/scrabble/src/scrabble.lisp branches/trunk-reorg/projects/scrabble/website/de/double-letter.png branches/trunk-reorg/projects/scrabble/website/de/double-word.png branches/trunk-reorg/projects/scrabble/website/de/scrabble.css branches/trunk-reorg/projects/scrabble/website/de/triple-letter.png branches/trunk-reorg/projects/scrabble/website/de/triple-word.png Log: checkpoint
Modified: branches/trunk-reorg/projects/scrabble/src/make-letters.lisp =================================================================== --- branches/trunk-reorg/projects/scrabble/src/make-letters.lisp 2007-10-05 06:04:47 UTC (rev 2220) +++ branches/trunk-reorg/projects/scrabble/src/make-letters.lisp 2007-10-05 07:31:39 UTC (rev 2221) @@ -4,16 +4,32 @@ (defparameter *special-tile-texts* (make-hash-table))
(setf (gethash :de *special-tile-texts*) - '(:double-letter "DOPPELTER\nBUCHSTABEN\nWERT" - :double-word "DOPPELTER\nWORT\nWERT" - :triple-letter "DREIFACHER\nBUCHSTABEN\nWERT" - :triple-word "DREIFACHER\nWORT\nWERT")) + '(:double-letter "DOPPELTER +BUCHSTABEN +WERT" + :double-word "DOPPELTER +WORT +WERT" + :triple-letter "DREIFACHER +BUCHSTABEN +WERT" + :triple-word "DREIFACHER +WORT +WERT"))
(setf (gethash :en *special-tile-texts*) - '(:double-letter "DOUBLE\nLETTER\nSCORE" - :double-word "DOUBLE\nWORD\nSCORE" - :triple-letter "TRIPLE\nLETTER\nSCORE" - :triple-word "TRIPLE\nWORD\nSCORE")) + '(:double-letter "DOUBLE +LETTER +SCORE" + :double-word "DOUBLE +WORD +SCORE" + :triple-letter "TRIPLE +LETTER +SCORE" + :triple-word "TRIPLE +WORD +SCORE"))
(defparameter *special-tile-colors* '(:double-letter (0.53 0.8 0.94) @@ -70,7 +86,11 @@ (cond (text (set-font regular-font 6) - (draw-centered-string 26 3 text)) + (let* ((lines (cl-ppcre:split "\n" text)) + (position (+ 20 (* 6 (/ 2 (length lines)))))) + (dolist (line lines) + (draw-centered-string 20 position line) + (decf position 6)))) (star )) (save-png (make-pathname :name (string-downcase (symbol-name name)) :type "png"))))) @@ -80,7 +100,8 @@ (make-special-tile tile-name (getf *special-tile-colors* tile-name) :text (getf (gethash language *special-tile-texts*) tile-name))) - (make-special-tile :standard (getf *special-tile-colors* :standard) :star t)) + (make-special-tile :standard (getf *special-tile-colors* :standard) :star nil) + (make-special-tile :standard (getf *special-tile-colors* :double-word) :star t))
(defun make-tile-set (directory language)
Modified: branches/trunk-reorg/projects/scrabble/src/package.lisp =================================================================== --- branches/trunk-reorg/projects/scrabble/src/package.lisp 2007-10-05 06:04:47 UTC (rev 2220) +++ branches/trunk-reorg/projects/scrabble/src/package.lisp 2007-10-05 07:31:39 UTC (rev 2221) @@ -1,6 +1,6 @@
(defpackage :scrabble - (:use :cl :alexandria :anaphora) + (:use :cl :alexandria :anaphora :bknr.datastore) (:export "*BOARD-SCORING*" "*TILE-SETS*" "FIELD-TYPE"))
Modified: branches/trunk-reorg/projects/scrabble/src/scrabble.lisp =================================================================== --- branches/trunk-reorg/projects/scrabble/src/scrabble.lisp 2007-10-05 06:04:47 UTC (rev 2220) +++ branches/trunk-reorg/projects/scrabble/src/scrabble.lisp 2007-10-05 07:31:39 UTC (rev 2221) @@ -8,7 +8,7 @@ (nil nil nil nil :double-word nil nil nil nil nil :double-word nil nil nil nil) (nil :triple-letter nil nil nil :triple-letter nil nil nil :triple-letter nil nil nil :triple-letter nil) (nil nil :double-letter nil nil nil :double-letter nil :double-letter nil nil nil :double-letter nil nil) - (:triple-word nil nil :double-letter nil nil nil :triple-word nil nil nil :double-letter nil nil :triple-word) + (:triple-word nil nil :double-letter nil nil nil :double-word nil nil nil :double-letter nil nil :triple-word) (nil nil :double-letter nil nil nil :double-letter nil :double-letter nil nil nil :double-letter nil nil) (nil :triple-letter nil nil nil :triple-letter nil nil nil :triple-letter nil nil nil :triple-letter nil) (nil nil nil nil :double-word nil nil nil nil nil :double-word nil nil nil nil) @@ -79,8 +79,9 @@ (or (< (x-of a) (x-of b)) (< (y-of a) (y-of b))))
-(defclass board () - ((placed-tiles :accessor placed-tiles-of :initform (make-array '(15 15) :initial-element nil)))) +(defclass board (store-object) + ((placed-tiles :accessor placed-tiles-of :initform (make-array '(15 15) :initial-element nil))) + (:metaclass persistent-class))
(defmethod print-object ((board board) stream) (print-unreadable-object (board stream :type t :identity t) @@ -99,9 +100,10 @@ (defmethod put-letter ((board board) tile x y) (setf (aref (placed-tiles-of board) x y) tile))
-(defclass tile () +(defclass tile (store-object) ((char :reader char-of :initarg :char) - (value :reader value-of :initarg :value))) + (value :reader value-of :initarg :value)) + (:metaclass persistent-class))
(defmethod print-object ((tile tile) stream) (print-unreadable-object (tile stream :type t :identity nil) @@ -109,10 +111,11 @@ (format stream "~A (~A)" char value))))
(defun make-tile (char value) - (make-instance 'tile :char char :value value)) + (make-object 'tile :char char :value value))
-(defclass tile-bag () - ((tiles :initarg :tiles :accessor tiles-of))) +(defclass tile-bag (store-object) + ((tiles :initarg :tiles :accessor tiles-of)) + (:metaclass persistent-class))
(defmethod remaining-tile-count ((tile-bag tile-bag)) (fill-pointer (tiles-of tile-bag)))
Modified: branches/trunk-reorg/projects/scrabble/website/de/double-letter.png =================================================================== (Binary files differ)
Modified: branches/trunk-reorg/projects/scrabble/website/de/double-word.png =================================================================== (Binary files differ)
Modified: branches/trunk-reorg/projects/scrabble/website/de/scrabble.css =================================================================== --- branches/trunk-reorg/projects/scrabble/website/de/scrabble.css 2007-10-05 06:04:47 UTC (rev 2220) +++ branches/trunk-reorg/projects/scrabble/website/de/scrabble.css 2007-10-05 07:31:39 UTC (rev 2221) @@ -114,7 +114,7 @@ #playfield #field-7-4 { background-image: url(standard.png); left: 308; top: 176 } #playfield #field-7-5 { background-image: url(standard.png); left: 308; top: 220 } #playfield #field-7-6 { background-image: url(standard.png); left: 308; top: 264 } -#playfield #field-7-7 { background-image: url(triple-word.png); left: 308; top: 308 } +#playfield #field-7-7 { background-image: url(double-word.png); left: 308; top: 308 } #playfield #field-7-8 { background-image: url(standard.png); left: 308; top: 352 } #playfield #field-7-9 { background-image: url(standard.png); left: 308; top: 396 } #playfield #field-7-10 { background-image: url(standard.png); left: 308; top: 440 }
Modified: branches/trunk-reorg/projects/scrabble/website/de/triple-letter.png =================================================================== (Binary files differ)
Modified: branches/trunk-reorg/projects/scrabble/website/de/triple-word.png =================================================================== (Binary files differ)