javaME跳棋源码

  • s9_938327
    了解作者
  • 77.7KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-13 03:10
    上传日期
j2me版中国跳棋源代码,希望对学习javame开发朋友们有帮助!
中国跳棋.rar
内容介绍
import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class GameMap extends Canvas implements CommandListener ,Runnable{ public int intRunMode = 0; //0-�ȴ��ʼ̬��1-����,2-�ȴ��û���Ӧ public boolean NowPlayer = true; //0-���壨�����ߣ���1-6�壨�����ߣ� private int rows = 0; private int column = 0; int canvash; int canvasw; int rows_distant; int column_distant; int radium; int chessSelected; boolean waitforPos = false; int DesPos = -1; //int keyNum0 = getKeyCode(Canvas.KEY_NUM0); MoveStack temp = null; boolean [] visited = new boolean[121]; boolean tryPlayer = false; private static int [] chessPos = {0 , 12 , 1 , 11 , 1 , 13 , 2 , 10 , 2 , 12 , 2 , 14 , 3 , 9 , 3 , 11 , 3 , 13 , 3 , 15 , 4 , 0 , 4 , 2 , 4 , 4 , 4 , 6 , 4 , 8 , 4 , 10 , 4 , 12 , 4 , 14 , 4 , 16 , 4 , 18 , 4 , 20 , 4 , 22 , 4 , 24 , 5 , 1 , 5 , 3 , 5 , 5 , 5 , 7 , 5 , 9 , 5 , 11 , 5 , 13 , 5 , 15 , 5 , 17 , 5 , 19 , 5 , 21 , 5 , 23 , 6 , 2 , 6 , 4 , 6 , 6 , 6 , 8 , 6 , 10 , 6 , 12 , 6 , 14 , 6 , 16 , 6 , 18 , 6 , 20 , 6 , 22 , 7 , 3 , 7 , 5 , 7 , 7 , 7 , 9 , 7 , 11 , 7 , 13 , 7 , 15 , 7 , 17 , 7 , 19 , 7 , 21 , 8 , 4 , 8 , 6 , 8 , 8 , 8 , 10 , 8 , 12 , 8 , 14 , 8 , 16 , 8 , 18 , 8 , 20 , 9 , 3 , 9 , 5 , 9 , 7 , 9 , 9 , 9 , 11 , 9 , 13 , 9 , 15 , 9 , 17 , 9 , 19 , 9 , 21 , 10, 2 , 10, 4 , 10, 6 , 10, 8 , 10, 10 , 10, 12 , 10, 14 , 10, 16 , 10, 18 , 10, 20 , 10, 22 , 11, 1 , 11, 3 , 11, 5 , 11, 7 , 11, 9 , 11, 11 , 11, 13 , 11, 15 , 11, 17 , 11, 19 , 11, 21 , 11, 23 , 12, 0 , 12, 2 , 12, 4 , 12, 6 , 12, 8 , 12, 10 , 12, 12 , 12, 14 , 12, 16 , 12, 18 , 12, 20 , 12, 22 , 12, 24 , 13, 9 , 13, 11 , 13, 13 , 13, 15 , 14, 10 , 14, 12 , 14, 14 , 15, 11 , 15, 13 , 16, 12 }; private char [] chesslabel = {'0','1','2','3','4','5','6','7','8','9'}; private int [] chessOnBoard= {111,112,113,114,115,116,117,118,119,120}; private int [] chessOnBoardOpposit = {0,1,2,3,4,5,6,7,8,9}; private boolean [] boardStatus = { true,true,true,true,true,true,true,true,true,true, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false,false, true,true,true,true,true,true,true,true,true,true}; private int [] chessPosNow = {13, 9 , 13, 11 , 13, 13 , 13, 15 , 14, 10 , 14, 12 , 14, 14 , 15, 11 , 15, 13 , 16, 12 }; private int [] chessPosNowOpposit = {0 , 12 , 1 , 11 , 1 , 13 , 2 , 10 , 2 , 12 , 2 , 14 , 3 , 9 , 3 , 11 , 3 , 13 , 3 , 15 }; private static int [][] ChessNeighbor = { { 2, 1, -1, -1, -1, -1, 22 }, { 4, 3, -1, 2, 0, -1, 21 }, { 5, 4, 1, -1, -1, 0, 34 }, { 7, 6, -1, 4, 1, -1, 20 }, { 8, 7, 3, 5, 2, 1, 33 }, { 9, 8, 4, -1, -1, 2, 45 }, { 15, 14, -1, 7, 3, -1, 19 }, { 16, 15, 6, 8, 4, 3, 32 }, { 17, 16, 7, 9, 5, 4, 44 }, { 18, 17, 8, -1, -1, 5, 55 }, { 23, -1, -1, 11, -1, -1, 0 }, { 24, 23, 10, 12, -1, -1, 2 }, { 25, 24, 11, 13, -1, -1, 5 }, { 26, 25, 12, 14, -1, -1, 9 }, { 27, 26, 13, 15, 6, -1, 18 }, { 28, 27, 14, 16, 7, 6, 31 }, { 29, 28, 15, 17, 8, 7, 43 }, { 30, 29, 16, 18, 9, 8, 54 }, { 31, 30, 17, 19, -1, 9, 64 }, { 32, 31, 18, 20, -1, -1, 74 }, { 33, 32, 19, 21, -1, -1, 85 }, { 34, 33, 20, 22, -1, -1, 97 }, { -1, 34, 21, -1, -1, -1, 110 }, { 35, -1, -1, 24, 11, 10, 1 }, { 36, 35, 23, 25, 12, 11, 4 }, { 37, 36, 24, 26, 13, 12, 8 }, { 38, 37, 25, 27, 14, 13, 17 }, { 39, 38, 26, 28, 15, 14, 30 }, { 40, 39, 27, 29, 16, 15, 42 }, { 41, 40, 28, 30, 17, 16, 53 }, { 42, 41, 29, 31, 18, 17, 63 }, { 43, 42, 30, 32, 19, 18, 73 }, { 44, 43, 31, 33, 20, 19, 84 }, { 45, 44, 32, 34, 21, 20, 96 }, { -1, 45, 33, -1, 22, 21, 109 }, { 46, -1, -1, 36, 24, 23, 3 }, { 47, 46, 35, 37, 25, 24, 7 }, { 48, 47, 36, 38, 26, 25, 16 }, { 49, 48, 37, 39, 27, 26, 29 }, { 50, 49, 38, 40, 28, 27, 41 }, { 51, 50, 39, 41, 29, 28, 52 }, { 52, 51, 40, 42, 30, 29, 62 }, { 53, 52, 41, 43, 31, 30, 72 }, { 54, 53, 42, 44, 32, 31, 83 }, { 55, 54, 43, 45, 33, 32, 95 }, { -1, 55, 44, -1, 34, 33, 108 }, { 56, -1, -1, 47, 36, 35, 6 }, { 57, 56, 46, 48, 37, 36, 15 }, { 58, 57, 47, 49, 38, 37, 28 }, { 59, 58, 48, 50, 39, 38, 40 }, { 60, 59, 49, 51, 40, 39, 51 }, { 61, 60, 50, 52, 41, 40, 61 }, { 62, 61, 51, 53, 42, 41, 71 }, { 63, 62, 52, 54, 43, 42, 82 }, { 64, 63, 53, 55, 44, 43, 94 }, { -1, 64, 54, -1, 45, 44, 107 }, { 66, 65, -1, 57, 47, 46, 14 }, { 67, 66, 56, 58, 48, 47, 27 }, { 68, 67, 57, 59, 49, 48, 39 }, { 69, 68, 58, 60, 50, 49, 50 }, { 70, 69, 59, 61, 51, 50, 60 }, { 71, 70, 60, 62, 52, 51, 70 }, { 72, 71, 61, 63, 53, 52, 81 }, { 73, 72, 62, 64, 54, 53, 93 }, { 74, 73, 63, -1, 55, 54, 106 }, { 76, 75, -1, 66, 56, -1, 13 }, { 77, 76, 65, 67, 57, 56, 26 }, { 78, 77, 66, 68, 58, 57, 38 }, { 79, 78, 67, 69, 59, 58, 49 }, { 80, 79, 68, 70, 60, 59, 59 }, { 81, 80, 69, 71, 61, 60, 69 }, { 82, 81, 70, 72, 62, 61, 80 }, { 83, 82, 71, 73, 63, 62, 92 }, { 84, 83, 72, 74, 64, 63, 105 }, { 85, 84, 73, -1, -1, 64, 114 }, { 87, 86, -1, 76, 65, -1, 12 }, { 88, 87, 75, 77, 66, 65, 25 }, { 89, 88, 76, 78, 67, 66, 37 }, { 90, 89, 77, 79, 68, 67, 48 }, { 91, 90, 78, 80, 69, 68, 58 }, { 92, 91, 79, 81, 70, 69, 68 }, { 93, 92, 80, 82, 71, 70, 79 }, { 94, 93, 81, 83, 72, 71, 91 }, { 95, 94, 82, 84, 73, 72, 104 }, { 96, 95, 83, 85, 74, 73, 113 }, { 97, 96, 84, -1, -1, 74, 117 }, { 99, 98, -1, 87, 75, -1, 11 }, { 100, 99, 86, 88, 76, 75, 24 }, { 101, 100, 87, 89, 77, 76, 36 }, { 102, 101, 88, 90, 78, 77, 47 }, { 103, 102, 89, 91, 79, 78, 57 }, { 104, 103, 90, 92, 80, 79, 67 }, { 105, 104, 91, 93, 81, 80, 78 }, { 106, 105, 92, 94, 82, 81, 90 }, { 107, 106, 93, 95, 83, 82, 103 }, {
评论
    相关推荐
    • javaME俄罗斯方块
      javaMe 俄罗斯方块,无任何素材,纯逻辑代码版
    • JavaME+API
      javame的唯一参考手册。因唯一,故而可贵。不信的话,先下下其它便宜的或免费的。 以下是JavaMe所设计的全部的包: MID Profile All Classes Packages java.io java.lang java.util javax.microedition.io ...
    • javame封装菜单
      刚刚开始学习javame 弄了好几天封装了个菜单,第一篇文章,谢谢大家捧场
    • JavaME开发实例
      javame开发的各种实例:寻找最短路径、画图、地图设置、Gps设置等等
    • javaMe 电话本
      实现javaMe应用于手机上的电话本功能,进行电话的插入、删除等功能。
    • javaME API
      javaME开发必备神器!
    • javame图片浏览器
      将要显示的图片放到默认的文件系统下,就可查看,其中包括放大,缩小代码,上下键可切换图片,在放大情况下,上下左右移动图片。
    • JavaMe示例演示
      JavaMe示例演示 javame源码 专门供学习参考
    • javaME教程
      java的ppt教程,主要是教导j2me开发,可进一步开发安卓
    • JavaME课件ppt
      JavaME上课所用的课件ppt,有兴趣的可以看看