📄 five.java
字号:
/*
* Five - gobang Game for Nokia series60 mobie,just for funny!!
*
* Copyright (C) 2003.3 runer <fqyy@hotmail.com>
* 版权所有 (C)2003.3 runer <fqyy@hotmail.com>
*
* 这个五子棋游戏是2003年3月份学习j2me编程时写的,因为程序比较简单,
* 代码结构不太好,但是j2me编程过程中的一些典型case都有涉及到,像
* 界面生成,按键控制,资源文件的读取,小内存编程等等。
*
* 这个游戏在编写时感觉有两个难点,一是界面部分,一是AI部分。
*
* 界面部分就是靠画出来了,很烦琐,但是没有好办法。
* 最开始的时候我是把棋子作为一个单独的class来做,
* 但是后来经过对比发现还是直接画出来比较省内存。
*
*
* AI属于常规编程,这里采用的是最笨的权值判断的方式。
* 如果有好的算法可以将其替换。
*
* 本代码建议仅供学习j2me编程使用。
*
* 2005.2.23
* 今天是我的生日,公布这个代码就当庆祝一下自己的生日吧
* 当时写这个程序的时候,感谢wda中文网(http://www.wda.com.cn)
* 中国java手机网(http://www.cnjm.net)
* 感谢昨天晚上第一个收到GT的短信祝福,还有别的很多朋友的短信,让我高兴了今天一天
* 也谢谢YWSY(http://bbs.ywsy.net)上的各位好朋友。
*
* 本软件是在GPL条款保护下发布,你可以免费使用并且可以获得所有的源代码。
* 但作者不提供任何形式的担保,无论是明确的还是隐含的。
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* http://www.gnu.org/copyleft/gpl.html
*
*/
package five;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Five extends MIDlet {
private static Five instance;
private GameCanvas displayable = new GameCanvas();
/** Constructor */
public Five() {
instance = this;
}
/** Main method */
public void startApp() {
Display.getDisplay(this).setCurrent(displayable);
}
/** Handle pausing the MIDlet */
public void pauseApp() {
}
/** Handle destroying the MIDlet */
public void destroyApp(boolean unconditional) {
}
/** Quit the MIDlet */
public static void quitApp() {
instance.destroyApp(true);
instance.notifyDestroyed();
instance = null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -