Kunstig Intelligens til Brætspillet Taiji - Danmarks Tekniske Universitet
Kunstig Intelligens til Brætspillet Taiji - Danmarks Tekniske Universitet Kunstig Intelligens til Brætspillet Taiji - Danmarks Tekniske Universitet
224 Bilag A 501 System . out . p r i n t l n (” t P r i n t PrintNode ”+n+” Depth : ”+n . d+” Score ”+n . a+” par ”+n . par+” w ”+n . wc+”,”+n . wr+” b ”+n . bc+”,”+n . br+” c h i l d r e n : ”+n . c h i l d r e n ) ; 502 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 0 ] + ” ”+n . nodeBoard [ 1 ] [ 0 ] + ” ”+n . nodeBoard [ 2 ] [ 0 ] + ” ”+n . nodeBoard [ 3 ] [ 0 ] + ” ”+ n . nodeBoard [ 4 ] [ 0 ] + ” ”+n . nodeBoard [ 5 ] [ 0 ] + ” ”+n . nodeBoard [ 6 ] [ 0 ] + ” ”+n . nodeBoard [ 7 ] [ 0 ] + ” ”+n . nodeBoard [ 8 ] [ 0 ] ) ; 503 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 1 ] + ” ”+n . nodeBoard [ 1 ] [ 1 ] + ” ”+n . nodeBoard [ 2 ] [ 1 ] + ” ”+n . nodeBoard [ 3 ] [ 1 ] + ” ”+ n . nodeBoard [ 4 ] [ 1 ] + ” ”+n . nodeBoard [ 5 ] [ 1 ] + ” ”+n . nodeBoard [ 6 ] [ 1 ] + ” ”+n . nodeBoard [ 7 ] [ 1 ] + ” ”+n . nodeBoard [ 8 ] [ 1 ] ) ; 504 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 2 ] + ” ”+n . nodeBoard [ 1 ] [ 2 ] + ” ”+n . nodeBoard [ 2 ] [ 2 ] + ” ”+n . nodeBoard [ 3 ] [ 2 ] + ” ”+ n . nodeBoard [ 4 ] [ 2 ] + ” ”+n . nodeBoard [ 5 ] [ 2 ] + ” ”+n . nodeBoard [ 6 ] [ 2 ] + ” ”+n . nodeBoard [ 7 ] [ 2 ] + ” ”+n . nodeBoard [ 8 ] [ 2 ] ) ; 505 i f ( tModel . noRows > 3) { 506 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 3 ] + ” ”+n . nodeBoard [ 1 ] [ 3 ] + ” ”+n . nodeBoard [ 2 ] [ 3 ] + ” ”+n . nodeBoard [ 3 ] [ 3 ] + ” ”+n . nodeBoard [ 4 ] [ 3 ] + ” ”+n . nodeBoard [ 5 ] [ 3 ] + ” ”+n . nodeBoard [ 6 ] [ 3 ] + ” ”+n . nodeBoard [ 7 ] [ 3 ] + ” ”+n . nodeBoard [ 8 ] [ 3 ] ) ; 507 i f ( tModel . noRows > 4) { 508 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 4 ] + ” ”+n . nodeBoard [ 1 ] [ 4 ] + ” ”+n . nodeBoard [ 2 ] [ 4 ] + ” ”+n . nodeBoard [ 3 ] [ 4 ] + ” ”+n . nodeBoard [ 4 ] [ 4 ] + ” ”+n . nodeBoard [ 5 ] [ 4 ] + ” ”+n . nodeBoard [ 6 ] [ 4 ] + ” ”+n . nodeBoard [ 7 ] [ 4 ] + ” ”+n . nodeBoard [ 8 ] [ 4 ] ) ; 509 i f ( tModel . noRows > 5) { 510 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 5 ] + ” ”+n . nodeBoard [ 1 ] [ 5 ] + ” ”+n . nodeBoard [ 2 ] [ 5 ] + ” ”+n . nodeBoard [ 3 ] [ 5 ] + ” ”+n . nodeBoard [ 4 ] [ 5 ] + ” ”+ n . nodeBoard [ 5 ] [ 5 ] + ” ”+n . nodeBoard [ 6 ] [ 5 ] + ” ”+n . nodeBoard [ 7 ] [ 5 ] + ” ”+n . nodeBoard [ 8 ] [ 5 ] ) ; 511 i f ( tModel . noRows > 6) { 512 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 6 ] + ” ”+n . nodeBoard [ 1 ] [ 6 ] + ” ”+n . nodeBoard [ 2 ] [ 6 ] + ” ”+n . nodeBoard [ 3 ] [ 6 ] + ” ”+n . nodeBoard [ 4 ] [ 6 ] + ” ”+n . nodeBoard [ 5 ] [ 6 ] + ” ”+n . nodeBoard [ 6 ] [ 6 ] + ” ”+n . nodeBoard [ 7 ] [ 6 ] + ” ”+n . nodeBoard [ 8 ] [ 6 ] ) ; 513 i f ( tModel . noRows > 7) { 514 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 7 ] + ” ”+n . nodeBoard [ 1 ] [ 7 ] + ” ”+n . nodeBoard [ 2 ] [ 7 ] + ” ”+n . nodeBoard [ 3 ] [ 7 ] + ” ”+n . nodeBoard [ 4 ] [ 7 ] + ” ”+n . nodeBoard [ 5 ] [ 7 ] + ” ”+n . nodeBoard [ 6 ] [ 7 ] + ” ”+n . nodeBoard [ 7 ] [ 7 ] + ” ”+n . nodeBoard [ 8 ] [ 7 ] ) ; 515 i f ( tModel . noRows > 8) { 516 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 8 ] + ” ”+n . nodeBoard [ 1 ] [ 8 ] + ” ”+n . nodeBoard [ 2 ] [ 8 ] + ” ”+n . nodeBoard [ 3 ] [ 8 ] + ” ”+n . nodeBoard [ 4 ] [ 8 ] + ” ”+n . nodeBoard [ 5 ] [ 8 ] + ” ”+n . nodeBoard [ 6 ] [ 8 ] + ” ”+n .
A.16 TaijiSettings.java 225 517 518 519 } 520 } 521 } 522 } 523 } 524 } 525 System . out . p r i n t l n ( ) ; 526 } 527 } A.16 TaijiSettings.java nodeBoard [ 7 ] [ 8 ] + ” ”+n . nodeBoard [ 8 ] [ 8 ] ) ; 1 import java . awt . event . ∗ ; 2 import javax . swing . ∗ ; 3 import java . awt . ∗ ; 4 5 p u b l i c c l a s s T a i j i S e t t i n g s extends JDialog { 6 // S e l v e d i a l o g e n s panel . 7 p r i v a t e JPanel mainPanel = new JPanel ( ) ; 8 9 // Radiobuttons t i l at v a e l g e AI og andre s e t t i n g s . 10 p r i v a t e JRadioButton oneButton = new JRadioButton (” Player VS Player ”) ; 11 p r i v a t e JRadioButton twoButton = new JRadioButton (” Player VS LocalArea ”) ; 12 p r i v a t e JRadioButton threeButton = new JRadioButton (” Player VS AlphaBeta ”) ; 13 p r i v a t e JRadioButton fourButton = new JRadioButton (” Player VS Growth ”) ; 14 p r i v a t e JRadioButton f i v e B u t t o n = new JRadioButton (” LocalArea VS Player ”) ; 15 p r i v a t e JRadioButton sixButton = new JRadioButton (” AlphaBeta VS Player ”) ; 16 p r i v a t e JRadioButton sevenButton = new JRadioButton (” Growth VS Player ”) ; 17 p r i v a t e ButtonGroup group = new ButtonGroup ( ) ; 18 19 //To knapper som godkende e l l e r a f v i s e r det a n t a l b l o c k s som e r v a l g t . 20 p r i v a t e JButton okButton = new JButton (”Ok”) ; 21 p r i v a t e JButton cancelButton = new JButton (” Cancel ”) ; 22 23 p r i v a t e TaijiFrame tFrame ; 24 25 // Constructor . 26 // Modtager en AtaxxFrame som argument . 27 p u b l i c T a i j i S e t t i n g s ( TaijiFrame frame ) 28 { 29 super ( frame , ” T a i j i s e t t i n g s ” , t r u e ) ;
- Page 184 and 185: 174 Bilag A 27 whiteScore = new Sco
- Page 186 and 187: 176 Bilag A 65 bc = 1 ; 66 e l s e
- Page 188 and 189: 178 Bilag A 58 p u b l i c void mou
- Page 190 and 191: 180 Bilag A 149 S t r i n g t x t =
- Page 192 and 193: 182 Bilag A l o a d i n g the f i l
- Page 194 and 195: 184 Bilag A 7 p u b l i c AITaijiMi
- Page 196 and 197: 186 Bilag A 105 i f ( b l a c k P l
- Page 198 and 199: 188 Bilag A 211 tBoard . s e t P i
- Page 200 and 201: 190 Bilag A 315 { 316 f o r ( i n t
- Page 202 and 203: 192 Bilag A 416 { 417 //Bunden 418
- Page 204 and 205: 194 Bilag A 510 p r i v a t e boole
- Page 206 and 207: 196 Bilag A 612 } 613 614 // b e r
- Page 208 and 209: 198 Bilag A 702 } 703 704 // s a e
- Page 210 and 211: 200 Bilag A 802 p u b l i c void ne
- Page 212 and 213: 202 Bilag A 59 g . f i l l R e c t
- Page 214 and 215: 204 Bilag A 159 { 160 t h i s . set
- Page 216 and 217: 206 Bilag A 81 System . out . p r i
- Page 218 and 219: 208 Bilag A [ 1 ] [ 7 ] + ” ”+n
- Page 220 and 221: 210 Bilag A 176 System . out . p r
- Page 222 and 223: 212 Bilag A 212 System . out . p r
- Page 224 and 225: 214 Bilag A 246 System . out . p r
- Page 226 and 227: 216 Bilag A [ 8 ] [ 2 ] ) ; 277 i f
- Page 228 and 229: 218 Bilag A 326 p u b l i c void pr
- Page 230 and 231: 220 Bilag A 393 i f ( tModel . noRo
- Page 232 and 233: 222 Bilag A 449 i f ( tModel . noRo
- Page 236 and 237: 226 Bilag A 30 31 tFrame = frame ;
- Page 238 and 239: 228 Bilag A 135 tFrame . tModel . s
- Page 240 and 241: 230
- Page 242 and 243: 232 Bilag B ”Introduction to Algo
- Page 244: 234
224 Bilag A<br />
501 System . out . p r i n t l n (” t P r i n t PrintNode ”+n+” Depth : ”+n . d+”<br />
Score ”+n . a+” par ”+n . par+” w ”+n . wc+”,”+n . wr+” b ”+n .<br />
bc+”,”+n . br+” c h i l d r e n : ”+n . c h i l d r e n ) ;<br />
502 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 0 ] + ” ”+n . nodeBoard<br />
[ 1 ] [ 0 ] + ” ”+n . nodeBoard [ 2 ] [ 0 ] + ” ”+n . nodeBoard [ 3 ] [ 0 ] + ” ”+<br />
n . nodeBoard [ 4 ] [ 0 ] + ” ”+n . nodeBoard [ 5 ] [ 0 ] + ” ”+n . nodeBoard<br />
[ 6 ] [ 0 ] + ” ”+n . nodeBoard [ 7 ] [ 0 ] + ” ”+n . nodeBoard [ 8 ] [ 0 ] ) ;<br />
503 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 1 ] + ” ”+n . nodeBoard<br />
[ 1 ] [ 1 ] + ” ”+n . nodeBoard [ 2 ] [ 1 ] + ” ”+n . nodeBoard [ 3 ] [ 1 ] + ” ”+<br />
n . nodeBoard [ 4 ] [ 1 ] + ” ”+n . nodeBoard [ 5 ] [ 1 ] + ” ”+n . nodeBoard<br />
[ 6 ] [ 1 ] + ” ”+n . nodeBoard [ 7 ] [ 1 ] + ” ”+n . nodeBoard [ 8 ] [ 1 ] ) ;<br />
504 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 2 ] + ” ”+n . nodeBoard<br />
[ 1 ] [ 2 ] + ” ”+n . nodeBoard [ 2 ] [ 2 ] + ” ”+n . nodeBoard [ 3 ] [ 2 ] + ” ”+<br />
n . nodeBoard [ 4 ] [ 2 ] + ” ”+n . nodeBoard [ 5 ] [ 2 ] + ” ”+n . nodeBoard<br />
[ 6 ] [ 2 ] + ” ”+n . nodeBoard [ 7 ] [ 2 ] + ” ”+n . nodeBoard [ 8 ] [ 2 ] ) ;<br />
505 i f ( tModel . noRows > 3) {<br />
506 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 3 ] + ” ”+n . nodeBoard<br />
[ 1 ] [ 3 ] + ” ”+n . nodeBoard [ 2 ] [ 3 ] + ” ”+n . nodeBoard<br />
[ 3 ] [ 3 ] + ” ”+n . nodeBoard [ 4 ] [ 3 ] + ” ”+n . nodeBoard<br />
[ 5 ] [ 3 ] + ” ”+n . nodeBoard [ 6 ] [ 3 ] + ” ”+n . nodeBoard<br />
[ 7 ] [ 3 ] + ” ”+n . nodeBoard [ 8 ] [ 3 ] ) ;<br />
507 i f ( tModel . noRows > 4) {<br />
508 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 4 ] + ” ”+n .<br />
nodeBoard [ 1 ] [ 4 ] + ” ”+n . nodeBoard [ 2 ] [ 4 ] + ” ”+n .<br />
nodeBoard [ 3 ] [ 4 ] + ” ”+n . nodeBoard [ 4 ] [ 4 ] + ” ”+n .<br />
nodeBoard [ 5 ] [ 4 ] + ” ”+n . nodeBoard [ 6 ] [ 4 ] + ” ”+n .<br />
nodeBoard [ 7 ] [ 4 ] + ” ”+n . nodeBoard [ 8 ] [ 4 ] ) ;<br />
509 i f ( tModel . noRows > 5) {<br />
510 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 5 ] + ” ”+n .<br />
nodeBoard [ 1 ] [ 5 ] + ” ”+n . nodeBoard [ 2 ] [ 5 ] + ” ”+n<br />
. nodeBoard [ 3 ] [ 5 ] + ” ”+n . nodeBoard [ 4 ] [ 5 ] + ” ”+<br />
n . nodeBoard [ 5 ] [ 5 ] + ” ”+n . nodeBoard [ 6 ] [ 5 ] + ”<br />
”+n . nodeBoard [ 7 ] [ 5 ] + ” ”+n . nodeBoard [ 8 ] [ 5 ] ) ;<br />
511 i f ( tModel . noRows > 6) {<br />
512 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 6 ] + ” ”+n .<br />
nodeBoard [ 1 ] [ 6 ] + ” ”+n . nodeBoard [ 2 ] [ 6 ] + ”<br />
”+n . nodeBoard [ 3 ] [ 6 ] + ” ”+n . nodeBoard<br />
[ 4 ] [ 6 ] + ” ”+n . nodeBoard [ 5 ] [ 6 ] + ” ”+n .<br />
nodeBoard [ 6 ] [ 6 ] + ” ”+n . nodeBoard [ 7 ] [ 6 ] + ”<br />
”+n . nodeBoard [ 8 ] [ 6 ] ) ;<br />
513 i f ( tModel . noRows > 7) {<br />
514 System . out . p r i n t l n ( n . nodeBoard [ 0 ] [ 7 ] + ”<br />
”+n . nodeBoard [ 1 ] [ 7 ] + ” ”+n . nodeBoard<br />
[ 2 ] [ 7 ] + ” ”+n . nodeBoard [ 3 ] [ 7 ] + ” ”+n .<br />
nodeBoard [ 4 ] [ 7 ] + ” ”+n . nodeBoard<br />
[ 5 ] [ 7 ] + ” ”+n . nodeBoard [ 6 ] [ 7 ] + ” ”+n .<br />
nodeBoard [ 7 ] [ 7 ] + ” ”+n . nodeBoard<br />
[ 8 ] [ 7 ] ) ;<br />
515 i f ( tModel . noRows > 8) {<br />
516 System . out . p r i n t l n ( n . nodeBoard<br />
[ 0 ] [ 8 ] + ” ”+n . nodeBoard [ 1 ] [ 8 ] + ”<br />
”+n . nodeBoard [ 2 ] [ 8 ] + ” ”+n .<br />
nodeBoard [ 3 ] [ 8 ] + ” ”+n . nodeBoard<br />
[ 4 ] [ 8 ] + ” ”+n . nodeBoard [ 5 ] [ 8 ] + ”<br />
”+n . nodeBoard [ 6 ] [ 8 ] + ” ”+n .