Board

From JavaWIDE Sandbox

Jump to: navigation, search

01 
02 /**
03  * All about my helper class.
04  @author hunt
05  */
06 public class Board
07 {
08 
09   private char moveLocs[];
10   
11   public Board()
12   {
13   
14     moveLocs = new char[ ];
15     
16     char ctr = '1';
17     
18     for int = 0; i < 9; i++ )
19     {
20       moveLocs[ ] = ctr;
21       ctr++;
22     }
23     
24   } // end constructor
25   
26   public void clearBoard()
27   {
28     char ctr = '1';
29     
30     for int = 0; i < 9; i++ )
31     {
32       moveLocs[ ] = ctr;
33       ctr++;
34     }
35     
36   } // end clearBoard()
37   
38   public void printBoard()
39   {
40   
41     System.out.println" " + moveLocs[ ] + " | " + moveLocs[ ] + " | " + moveLocs[ ] + "\n" +
42                         "---|---|---" + "\n" +
43                         " " + moveLocs[ ] + " | " + moveLocs[ ] + " | " + moveLocs[ ] + "\n" +
44                         "---|---|---" + "\n" +
45                         " " + moveLocs[ ] + " | " + moveLocs[ ] + " | " + moveLocs[ ] + "\n" );
46   }
47   
48   public void makeMoveint loc, char )
49   {
50     moveLocs[ loc ] = c;
51   }
52   
53   public char getCharint )
54   {
55     return moveLocs[ ];
56   }
57   
58 } // end class Board


Download/View Board.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter