⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tictacgame.java

📁 網路連線圈圈叉叉...... 可以互相連線
💻 JAVA
字号:
   import java.io.*;

   public class TicTacGame implements Serializable {
      char[] pos = {' ',' ',' ',' ',' ',' ',' ',' ',' '};
      public void clearAll() {
         for (int i=0;i<9;i++) 
            pos[i] = ' ';
      
      }
      public void clear(int i) {
         pos[i]=' ';
      }
      public void clear(int x, int y) {
         pos[x+y*3]=' ';
      }
      public void putX(int i) {
         pos[i]='X';
      }
      public void putX(int x, int y) {
         pos[x+y*3]='X';
      }
   
      public void putO(int i) {
         pos[i]='O';
      }
      public void putO(int x, int y) {
         pos[x+y*3]='O';
      }
      public char get(int i) {
         return pos[i];
      }
      public char get(int x, int y) {
         return pos[x+3*y];
      }
   }	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -