°ú¸ñ: | Programming Language |
±³¼ö: | ÇÑ»ó¿µ |
Á¦ÃâÀÏ: | 6-Nov-97 |
Á¦ÃâÀÚ: | ±è±â¿ë, 93208-002, Áö¸®Çаú |
¸ðµç cell ÀÌ L ÀÏ ¶§ cross ¿¡ ÇØ´çÇÏ´Â cell À» ¸ðµÎ ´©¸£°Ô
µÇ¸é rest ¿¡ ÀÖ´Â cell µéÀº x ¿ÀÌ ´¸± ¶§ ÇÔ²² S ·Î
toggle µÇ¾ú´Ù°¡ y ÇàÀÌ ´¸± ¶§ ´Ù½Ã L ·Î µ¹¾Æ¿À¹Ç·Î ¿µÇâÀ» ¹ÞÁö
¾Ê´Â´Ù. cross cell Áß y Çà¿¡ ÀÖ´Â cell ÀÇ ¼ö´Â (x, y) ¸¦
Á¦¿ÜÇßÀ¸¹Ç·Î ¦¼ö °³À̱⠶§¹®¿¡ ÀÌµé ¿ª½Ã ¿µÇâÀ» ¹ÞÁö ¾Ê´Â´Ù.
x ¿µµ ¸¶Âù°¡Áö·Î Àû¿ëÇØ º¸¸é cross ¿¡ ÇØ´çÇÏ´Â cell À»
¸ðµÎ ´©¸£´Â °ÍÀº board ¿¡ ÀÖ´Â ¾î´À cell ¿¡µµ ¿µÇâÀ» ³¢Ä¡Áö ¾Ê´Â´Ù´Â
°ÍÀ» ¾Ë ¼ö ÀÖ´Ù.
°á±¹ (x, y) ¸¦ ´©¸£´Â °ÍÀº (x, y) ¿Í cross ¸¦ ÇÔ²² ´©¸£´Â
°Í°ú °°Àº °á°ú¸¦ ³²±ä´Ù´Â °ÍÀÌ°í, ÀÌ°ÍÀº (x, y) ¸¦ ´·¯ »ý±ä
2n-1 °³ÀÇ S ¸¦ ¸ðµÎ ´©¸£¸é ´Ù½Ã ¸ðµÎ L ÀÎ »óÅ·Πµ¹¾Æ¿Ã ¼ö ÀÖ´Ù´Â
°ÍÀ» ÀǹÌÇÑ´Ù.
µÎ ¹ø° (x2, y2) ¸¦ ´©¸£°Ô µÇ¸é (x, y) ÀÇ cross ¿Í
(x2, y2) ÀÇ cross ´Â °ãÃÄÁ®¼ µÎ ¹øÀ» ´·¯¾ß ÇÏÁö¸¸,
´Ù½Ã L ·Î µ¹¾Æ¿À´Â °ÍÀ̱⠶§¹®¿¡ ´©¸¦ ÇÊ¿ä°¡ ¾ø¾îÁ®¼ ¿©ÀüÈ÷
¸ðµç S ¸¦ ´©¸£´Â °ÍÀ¸·Î ¹®Á¦¸¦ Ç® ¼ö ÀÖ°Ô µÈ´Ù.
°è¼ÓÇؼ (xn, yn) À» ´©¸£°Ô µÇ¸é
(xn, yn) À» ã¾Æ³»´Â °ÍÀº ¾î·ÆÁö¸¸
S ´Â ¹Ù·Î º¸À̱⠶§¹®¿¡ board ¿¡¼ S ÀÇ À§Ä¡¸¦ ±â¾ïÇß´Ù°¡ ¸ðµÎ
´©¸£¸é ¹®Á¦¸¦ Ç® ¼ö ÀÖ°Ô µÈ´Ù.
ÀÌ »óÅ¿¡¼ (x, y) ¸¦ ´·¯ º¸ÀÚ. Áï, cross ¿Í (x, y) ¸¦
¸ðµÎ ´©¸£´Â °ÍÀÌ´Ù. ÀÌ·¸°Ô Çϸé (x, y) ¸¸ÀÌ toggle µÇ°í ³ª¸ÓÁö
cross ¿Í rest ¿¡´Â ÀüÇô ¿µÇâÀ» ÁÖÁö ¾Ê´Â´Ù.
¦¼ö x ¦¼ö ¿¡¼´Â ÀÌ·¸°Ô ÇϳªÀÇ cell ¸¸ toggle ÇÏ´Â °ÍÀÌ
°¡´ÉÇϱ⠶§¹®¿¡ Ȧ¼öÀÏ ¶§¿Í ´Þ¸® ¾î¶² ÇüÅÂÀÇ board ¶óµµ
¸¸µé ¼ö ÀÖ´Ù.
µû¶ó¼, ¦¼ö x ¦¼ö board ÀÇ ÇعýÀº, S ÀÇ À§Ä¡¸¦ ±â¾ïÇß´Ù°¡
±â¾ïÇÑ ¸ðµç S ¿¡ ´ëÇؼ (x, y) ¿Í cross ¸¦ ¸ðµÎ ´·¯ ÁÖ¸é
¹®Á¦¸¦ Ç® ¼ö ÀÖ°Ô µÈ´Ù´Â °ÍÀÌ´Ù.
ù¹ø°´Â, cross ÀÇ ¼ºÁúÀ» ÀÌ¿ëÇÏ´Â °ÍÀÌ´Ù.
Çعý¿¡¼ ÁöÀûÇÑ ´ë·Î cross ´Â ¸ðµÎ ´©¸£´Â °Í°ú
Çϳªµµ ´©¸£Áö ¾Ê´Â °ÍÀÇ °á°ú°¡ °°´Ù. µû¶ó¼, ´·¯¾ß ÇÒ °÷À» ±â¾ïÇØ
³õÀº ºÎºÐ¿¡¼ cross ¸¦ toggle ÇÏ¿© ´·¯¾ß ÇÒ °÷ÀÌ ÁÙ¾îµé°Ô
µÈ´Ù¸é À̵æÀÎ °ÍÀÌ´Ù.
µÎ¹ø°¸¦ ¼³¸íÇϱâ À§ÇØ ¸ÕÀú ´ÙÀ½°ú °°Àº »óȲÀ» »ý°¢ÇØ º¸ÀÚ.
¼·Î ´Ù¸¥ µÎ Á¡ (x1, y) ¿Í (x2, y) °¡ ÀÖ´Ù°í ÇÒ ¶§
x1 ¿°ú x2 ¿ÀÇ ¸ðµç cell Áß (x1, y), (x2, y) ¸¦ Á¦¿ÜÇÑ ºÎºÐÀ»
parallel À̶ó ºÎ¸£±â·Î ÇÏÀÚ. µÎ Á¡ (x1, y) °ú (x2, y) ¸¦ ´©¸£°Ô
µÇ¸é parallel ºÎºÐÀº ¸ðµÎ toggle µÉ °ÍÀÌ´Ù. x1 °ú x2 °¡ ¼ÓÇÑ
ÇàÀº µÎ ¹ø toggle µÉ °ÍÀ̹ǷΠ¿ø·¡´ë·Î µ¹¾Æ¿Â´Ù. µû¶ó¼,
parallel ºÎºÐÀ» toggle ÇÏ´Â °Íº¸´Ù (x1, y) ¿Í (x2, y) ÀÇ µÎ Á¡À»
´©¸£´Â °ÍÀÌ ´õ Ƚ¼ö¸¦ ÁÙÀÏ ¼ö ÀÖ´Â °ÍÀÌ´Ù.
´·¯¾ß ÇÒ °÷À» board copy ¿¡ ±â¾ïÇØ µÎ¾ú´Ù¸é, (x1, y) ¿Í (x2, y) ¸¦
´·¯¾ß ÇÏ´ÂÁöÀÇ ¿©ºÎ¸¦ toggle ÇÏ´Â °ÍÀ¸·Î parallel ºÎºÐ Áß
´·¯¾ß ÇÒ °÷Àº ´©¸¦ ÇÊ¿ä°¡ ¾ø°Ô µÇ°í ´©¸¦ ÇÊ¿ä°¡ ¾ø´ø °÷Àº
ÀÌÁ¦ ´·¯¾ß ÇÏ°Ô µÇ¾ú´Ù. (x1, y), (x2, y) ¿Í parallel ÀÇ toggle ¿©ºÎ¸¦
¸ðµÎ ¹Ù²Ù¾î¼ ´·¯¾ß ÇÏ´Â °ÍÀÌ ÁÙ¾îµç´Ù¸é, Ƚ¼ö»ó À̵æÀÌ µÈ´Ù.
µû¶ó¼ ÆòÇàÇÑ µÎ ÁÙÀÇ "´·¯¾ß ÇÏ´ÂÁöÀÇ ¿©ºÎ"¸¦ toggle Çϸé
¿ø·¡¿Í °°Àº °á°ú¸¦ ¾òÀ» ¼ö ÀÖ´Â °ÍÀÌ´Ù.
À§ µÎ °¡Áö Optimizing ÀÇ »ç¿ë ¿©ºÎ¿¡ µû¸¥ ¼º´ÉÀ» ¾Æ·¡ Ç¥¿¡ Á¤¸®ÇÏ¿´´Ù.
¼ýÀÚ´Â 5 x 5 Board ¸¦ N ¹ø ´·¯ ¼¯¾úÀ» ¶§ ¸î ¹ø¸¸¿¡ ¹®Á¦¸¦ Ǫ´Â°¡¸¦,
10000¹ø ½ÇÇà½ÃŲ Æò±Õ°ú Ç¥ÁØÆíÂ÷·Î ³ªÅ¸³½ °ÍÀÌ´Ù.
¸¹ÀÌ ¼¯¾úÀ» ¶§´Â µÎ ¹æ¹ýÀ» »ç¿ëÇÏ´Â °ÍÀÌ ºñ½ÁÇÑ È¿À²À» º¸¿´Áö¸¸,
ÇÑ ¹ø¸¸ ¼¯¾úÀ» ¶§´Â ù¹ø° ¹æ¹ýÀÌ, µÎ ¹ø¸¸ ¼¯¾úÀ» ¶§´Â µÎ¹ø° ¹æ¹ýÀÌ
¿ùµîÇÑ ¼º´ÉÀ» º¸¿© ÁÖ¾ú´Ù. ¼¯Àº ¼ö¿¡ °ü°è ¾øÀÌ, µÎ¹æ¹ýÀ» ¸ðµÎ Àû¿ëÇÑ
°ÍÀÌ °¡Àå ³ª¾Ò´Ù.
Çعý
ÆíÀÇ»ó (x, y) ¸¦ ´©¸¦ ¶§ x ¿°ú y Çà¿¡ ÀÖÀ¸¸ç (x, y) °¡ ¾Æ´Ñ cell À»
cross, x ¿¿¡µµ y Çà¿¡µµ ÀÖÁö ¾ÊÀº cell À» rest ¶ó
ºÎ¸£±â·Î ÇÏÀÚ.
R
R
C
R
R
R
R
C
R
R
C
C
x,y
C
C
R
R
C
R
R
R
R
C
R
R
(x, y)
Cross
Rest
Ȧ¼ö x Ȧ¼öÀÏ ¶§¿Í °°ÀÌ cross ¿Í rest ¸¦ Á¤ÀÇÇÏÀÚ.
cross ¸¦ ¸ðµÎ ´©¸£¸é rest ´Â Ȧ¼öÀÏ ¶§¿Í ¸¶Âù°¡Áö·Î
¿µÇâÀ» ¹ÞÁö ¾ÊÁö¸¸, cross ÀÚü¿¡ ´ëÇÑ °á°ú°¡ ´Ù¸£´Ù.
cross ÀÇ y Çà¿¡ ÀÖ´Â cell ÀÇ °¹¼ö´Â (x, y) ¸¦ Á¦¿ÜÇßÀ¸¹Ç·Î
Ȧ¼ö°¡ µÈ´Ù. µû¶ó¼ cross ¸¦ ´©¸£¸é cross ºÎºÐÀÇ
cell ÀÌ ¸ðµÎ toggle µÇ´Â °á°ú¸¦ ³º´Â´Ù. ¹Ý¸é, (x, y) ´Â
cross ÀÇ x ¿°ú y ÇàÀ¸·ÎºÎÅÍ ¸ðµÎ ¿µÇâÀ» ¹Þ±â ¶§¹®¿¡
¦¼ö ¹øÀÌ ´¸®°Ô µÇ¾î ¿ø·¡ »óÅ·Πµ¹¾Æ¿Â´Ù.
Optimizing
N of Scrambles
No optimization
optimize1()
optimize2()
optimize1 & optimize2()
Avg. SD
Avg. SD
Avg. SD
Avg. SD
1
9.00 0.00
1.00 0.00
7.00 0.00
1.00 0.00
2
11.53 3.65
3.81 2.87
1.92 0.40
1.92 0.39
3
12.26 2.86
5.01 2.89
6.82 1.13
4.50 2.66
4
12.42 2.67
5.63 2.55
5.43 2.69
4.78 2.11
5
12.42 2.57
6.11 2.15
6.42 1.06
5.70 2.07
6
12.52 2.48
6.46 2.13
6.47 2.15
5.85 1.79
7
12.49 2.51
6.71 1.84
6.45 0.99
6.25 1.72
8
12.47 2.49
6.85 1.88
6.80 1.84
6.19 1.55
9
12.52 2.52
6.97 1.68
6.52 0.90
6.52 1.52
10
12.49 2.50
7.00 1.73
6.99 1.68
6.35 1.40
100
12.49 2.51
7.17 1.67
7.11 1.53
6.75 1.41
Implimentation
n °³ÀÇ 'L ·Î ÀÌ·ç¾î Áø List ¸¦ ¸¸µé¾î ³½´Ù.
createLine ÀÌ return ÇÑ List n °³·Î
ÀÌ·ç¾î Áø List ¸¦ ¸¸µé¾î ³½´Ù.
(x, y) ¿¡ À§Ä¡ÇÑ cell ÀÇ ³»¿ëÀ» return ÇÑ´Ù.
'L ¶Ç´Â 'S ÀÌ´Ù.
(x, y) ¸¦ toggle ÇÑ´Ù.
(x, y) ¸¦ ´·¯¼ x ¿°ú y ÇàÀÌ ¸ðµÎ toggle µÇµµ·Ï ÇÑ´Ù.
Ȧ¼öÀÏ ¶§´Â 'S ÀÇ À§Ä¡°¡ ¹Ù·Î ´·¯¾ß ÇÒ °÷ÀÌ´Ù.
¦¼öÀÏ ¶§ ´·¯¾ß ÇÒ °÷À» °è»êÇÑ´Ù.
copy ¿¡ ÁöÁ¤µÈ, ´·¯¾ß ÇÒ ÁÂÇ¥¸¦ ¾ò¾î board ¿¡ ´©¸¥´Ù.
board ¸¦ n x n ÀÇ ÇüÅ·ΠÃâ·ÂÇØ ÁØ´Ù.
ÁÖ¾îÁø ¼ýÀÚ°¡ Ȧ¼öÀÎÁö ¿©ºÎ¸¦ returnÇÑ´Ù.
board ¸¦ ÁöÁ¤ÇÑ ¼ö¸¸Å ¼¯´Â´Ù.
Misc.
; ; lsgame.lisp ; ; Programming Languages Assignment #3 ; ; created by: Kim, Ki-Yong, 93208-002, Dept. of Geography ; (defun init () (setf board_size 5) (setf n_scramble 50) (setf optimizing_method 'opt1_and_opt2)) (defun createLine (size) (let ((line nil)) (dotimes (x size line) (setf line (cons 'L line))))) (defun createBoard (size) (let ((matrix ())) (dotimes (y size matrix) (setf matrix (cons (createLine size) matrix))))) (defun getXY (board x y) (nth x (nth y board))) (defun reverseXY (board x y) (setf (nth x (nth y board)) (if (eq (getXY board x y) 'L) 'S 'L))) (defun isOdd (num) (let ((flag nil)) (multiple-value-bind (quotient remainder) (truncate num 2) (setf result (= remainder 1))))) (defun copyBoard (board) (let ((copy (createBoard board_size))) (dotimes (y board_size copy) (dotimes (x board_size copy) (setf (nth x (nth y copy)) (getXY board x y)))))) (defun setEvenXY (board x y) (dotimes (i board_size) (reverseXY board x i) (if (= i x) 'X (reverseXY board i y)))) (defun copyForEven (board) (let ((copy (createBoard board_size))) (dotimes (y board_size copy) (dotimes ( x board_size copy) (when (eq (getXY board x y) 'S) (setEvenXY copy x y)))))) (defun pressXY (board x y) (dotimes (i board_size) (reverseXY board x i) (if (= x i) 'X (reverseXY board i y)))) (defun getCross (board x y) (let ((count 0)) (dotimes (i board_size count) (setf count (if (eq (getXY board x i) 'L) count (+ count 1))) (setf count (if (or (= x i) (eq (getXY board i y) 'L) ) count (+ count 1)) ) ) ) ) (defun getParallel (board i1 i2 type) (let ((count 0) (x 0) (y 0)) (dotimes (i board_size count) (setf x (if (eq type 'HORZ) i i1)) (setf y (if (eq type 'HORZ) i1 i)) (setf count (if (eq (getXY board x y) 'L) count (+ count 1))) (setf x (if (eq type 'HORZ) i i2)) (setf y (if (eq type 'HORZ) i2 i)) (setf count (if (eq (getXY board x y) 'L) count (+ count 1))) ) ) ) (defun reverseCross (board x y) (pressXY board x y) (reverseXY board x y)) (defun reverseParallel (board i1 i2 type) (let ((x 0) (y 0)) (dotimes (i board_size) (setf x (if (eq type 'HORZ) i i1)) (setf y (if (eq type 'HORZ) i1 i)) (reverseXY board x y) (setf x (if (eq type 'HORZ) i i2)) (setf y (if (eq type 'HORZ) i2 i)) (reverseXY board x y) ) ) ) (defun optimize1 (board) (loop (let ((nCross 0) (nMaxCross 0) (xMax 0) (yMax 0)) (dotimes (y board_size) (dotimes (x board_size) (setf nCross (getCross board x y)) (when (< nMaxCross nCross) (setf nMaxCross nCross) (setf xMax x) (setf yMax y)))) (when (<= nMaxCross board_size) (return NIL)) (reverseCross board xMax yMax)))) (defun optimize2 (board) (loop (let ((typeMax 'HORZ) (nPara 0) (nMaxPara 0) (i1Max 0) (i2Max 0)) (dotimes (i1 (- board_size 1)) (dotimes (i2 board_size) (when (< i1 i2) (dolist (type (list 'HORZ 'VERT)) (setf nPara (getParallel board i1 i2 type)) (when (< nMaxPara nPara) (setf nMaxPara nPara) (setf i1Max i1) (setf i2Max i2) (setf typeMax type)))))) (when (<= nMaxPara board_size) (return NIL)) (reverseParallel board i1Max i2Max typeMax) ) ) ) (defun scramble (board times randomstate) (let ((x 0) (y 0)) (dotimes (i times board) (setf x (random board_size randomstate)) (setf y (random board_size randomstate)) (format t "~%Pressing #~a, (~a, ~a)..." (+ i 1) x y) (pressXY board x y) (print_board board)))) (defun print_board (board) (dolist (line board) (print line)) (print '------)) (defun solve (board copy) (print 'Solving...) (let ((nSolve 0)) (dotimes (y board_size) (dotimes (x board_size) (when (eq (getXY copy x y) 'S) (pressXY board x y) (setf nSolve (+ nSolve 1)) (format t "~%Solving #~a, (~a, ~a)..." nSolve x y) (print_board board)) ) ) ) ) (defun LSGame () (init) (setf rs (make-random-state t)) (setf board (scramble (createBoard board_size) n_scramble rs)) (setf copy (if (isOdd board_size) (copyBoard board) (copyForEven board))) (print "Before Optimizing") (print_board copy) (when (isOdd board_size) (when (or (eq optimizing_method 'opt1_only) (eq optimizing_method 'opt1_and_opt2)) (optimize1 copy)) (when (or (eq optimizing_method 'opt2_only) (eq optimizing_method 'opt1_and_opt2)) (optimize2 copy))) (print "After Optimizing") (print_board copy) (solve board copy) ) (LSGame)
#clisp -q < lsgame.lisp INIT CREATELINE CREATEBOARD GETXY REVERSEXY ISODD COPYBOARD SETEVENXY COPYFOREVEN PRESSXY GETCROSS GETPARALLEL REVERSECROSS REVERSEPARALLEL OPTIMIZE1 OPTIMIZE2 SCRAMBLE PRINT_BOARD SOLVE LSGAME Pressing #1, (2, 3)... (L L S L L) (L L S L L) (L L S L L) (S S S S S) (L L S L L) ------ Pressing #2, (4, 1)... (L L S L S) (S S L S S) (L L S L S) (S S S S L) (L L S L S) ------ Pressing #3, (3, 4)... (L L S S S) (S S L L S) (L L S S S) (S S S L L) (S S L S L) ------ Pressing #4, (4, 1)... (L L S S L) (L L S S L) (L L S S L) (S S S L S) (S S L S S) ------ Pressing #5, (3, 0)... (S S L L S) (L L S L L) (L L S L L) (S S S S S) (S S L L S) ------ Pressing #6, (3, 3)... (S S L S S) (L L S S L) (L L S S L) (L L L L L) (S S L S S) ------ Pressing #7, (2, 1)... (S S S S S) (S S L L S) (L L L S L) (L L S L L) (S S S S S) ------ Pressing #8, (2, 2)... (S S L S S) (S S S L S) (S S S L S) (L L L L L) (S S L S S) ------ Pressing #9, (4, 0)... (L L S L L) (S S S L L) (S S S L L) (L L L L S) (S S L S L) ------ Pressing #10, (2, 2)... (L L L L L) (S S L L L) (L L L S S) (L L S L S) (S S S S L) ------ Pressing #11, (2, 0)... (S S S S S) (S S S L L) (L L S S S) (L L L L S) (S S L S L) ------ Pressing #12, (2, 3)... (S S L S S) (S S L L L) (L L L S S) (S S S S L) (S S S S L) ------ Pressing #13, (4, 1)... (S S L S L) (L L S S S) (L L L S L) (S S S S S) (S S S S S) ------ Pressing #14, (0, 0)... (L L S L S) (S L S S S) (S L L S L) (L S S S S) (L S S S S) ------ Pressing #15, (2, 0)... (S S L S L) (S L L S S) (S L S S L) (L S L S S) (L S L S S) ------ Pressing #16, (2, 0)... (L L S L S) (S L S S S) (S L L S L) (L S S S S) (L S S S S) ------ Pressing #17, (4, 0)... (S S L S L) (S L S S L) (S L L S S) (L S S S L) (L S S S L) ------ Pressing #18, (1, 3)... (S L L S L) (S S S S L) (S S L S S) (S L L L S) (L L S S L) ------ Pressing #19, (0, 2)... (L L L S L) (L S S S L) (L L S L L) (L L L L S) (S L S S L) ------ Pressing #20, (3, 2)... (L L L L L) (L S S L L) (S S L S S) (L L L S S) (S L S L L) ------ Pressing #21, (1, 1)... (L S L L L) (S L L S S) (S L L S S) (L S L S S) (S S S L L) ------ Pressing #22, (3, 0)... (S L S S S) (S L L L S) (S L L L S) (L S L L S) (S S S S L) ------ Pressing #23, (4, 1)... (S L S S L) (L S S S L) (S L L L L) (L S L L L) (S S S S S) ------ Pressing #24, (4, 3)... (S L S S S) (L S S S S) (S L L L S) (S L S S S) (S S S S L) ------ Pressing #25, (2, 3)... (S L L S S) (L S L S S) (S L S L S) (L S L L L) (S S L S L) ------ Pressing #26, (4, 4)... (S L L S L) (L S L S L) (S L S L L) (L S L L S) (L L S L S) ------ Pressing #27, (1, 1)... (S S L S L) (S L S L S) (S S S L L) (L L L L S) (L S S L S) ------ Pressing #28, (3, 0)... (L L S L S) (S L S S S) (S S S S L) (L L L S S) (L S S S S) ------ Pressing #29, (0, 4)... (S L S L S) (L L S S S) (L S S S L) (S L L S S) (S L L L L) ------ Pressing #30, (2, 0)... (L S L S L) (L L L S S) (L S L S L) (S L S S S) (S L S L L) ------ Pressing #31, (4, 3)... (L S L S S) (L L L S L) (L S L S S) (L S L L L) (S L S L S) ------ Pressing #32, (0, 3)... (S S L S S) (S L L S L) (S S L S S) (S L S S S) (L L S L S) ------ Pressing #33, (1, 2)... (S L L S S) (S S L S L) (L L S L L) (S S S S S) (L S S L S) ------ Pressing #34, (4, 2)... (S L L S L) (S S L S S) (S S L S S) (S S S S L) (L S S L L) ------ Pressing #35, (1, 3)... (S S L S L) (S L L S S) (S L L S S) (L L L L S) (L L S L L) ------ Pressing #36, (4, 1)... (S S L S S) (L S S L L) (S L L S L) (L L L L L) (L L S L S) ------ Pressing #37, (1, 2)... (S L L S S) (L L S L L) (L S S L S) (L S L L L) (L S S L S) ------ Pressing #38, (2, 2)... (S L S S S) (L L L L L) (S L L S L) (L S S L L) (L S L L S) ------ Pressing #39, (4, 1)... (S L S S L) (S S S S S) (S L L S S) (L S S L S) (L S L L L) ------ Pressing #40, (3, 2)... (S L S L L) (S S S L S) (L S S L L) (L S S S S) (L S L S L) ------ Pressing #41, (1, 1)... (S S S L L) (L L L S L) (L L S L L) (L L S S S) (L L L S L) ------ Pressing #42, (0, 1)... (L S S L L) (S S S L S) (S L S L L) (S L S S S) (S L L S L) ------ Pressing #43, (4, 2)... (L S S L S) (S S S L L) (L S L S S) (S L S S L) (S L L S S) ------ Pressing #44, (2, 3)... (L S L L S) (S S L L L) (L S S S S) (L S L L S) (S L S S S) ------ Pressing #45, (4, 2)... (L S L L L) (S S L L S) (S L L L L) (L S L L L) (S L S S L) ------ Pressing #46, (2, 0)... (S L S S S) (S S S L S) (S L S L L) (L S S L L) (S L L S L) ------ Pressing #47, (4, 0)... (L S L L L) (S S S L L) (S L S L S) (L S S L S) (S L L S S) ------ Pressing #48, (1, 2)... (L L L L L) (S L S L L) (L S L S L) (L L S L S) (S S L S S) ------ Pressing #49, (1, 2)... (L S L L L) (S S S L L) (S L S L S) (L S S L S) (S L L S S) ------ Pressing #50, (2, 2)... (L S S L L) (S S L L L) (L S L S L) (L S L L S) (S L S S S) ------ "Before Optimizing" (L S S L L) (S S L L L) (L S L S L) (L S L L S) (S L S S S) ------ "After Optimizing" (L L S L L) (S L L L L) (L L L S L) (L L L L S) (L L L L L) ------ SOLVING... Solving #1, (2, 0)... (S L L S S) (S S S L L) (L S S S L) (L S S L S) (S L L S S) ------ Solving #2, (0, 1)... (L L L S S) (L L L S S) (S S S S L) (S S S L S) (L L L S S) ------ Solving #3, (3, 2)... (L L L L S) (L L L L S) (L L L L S) (S S S S S) (L L L L S) ------ Solving #4, (4, 3)... (L L L L L) (L L L L L) (L L L L L) (L L L L L) (L L L L L) ------ NIL