當前位置:首頁 » 操作系統 » 黑白棋源碼

黑白棋源碼

發布時間: 2024-01-04 06:45:01

Ⅰ 急求俄羅斯方塊等小游戲的源代碼

俄羅斯方塊——java源代碼提供
import java.awt.*;
import java.awt.event.*;
//俄羅斯方塊類
public class ERS_Block extends Frame{
public static boolean isPlay=false;
public static int level=1,score=0;
public static TextField scoreField,levelField;

public static MyTimer timer;
GameCanvas gameScr;

public static void main(String[] argus){
ERS_Block ers = new ERS_Block("俄羅斯方塊游戲 V1.0 Author:Vincent");
WindowListener win_listener = new WinListener();
ers.addWindowListener(win_listener);
}

//俄羅斯方塊類的構造方法
ERS_Block(String title){
super(title);

setSize(600,480);
setLayout(new GridLayout(1,2));

gameScr = new GameCanvas();
gameScr.addKeyListener(gameScr);

timer = new MyTimer(gameScr);
timer.setDaemon(true);
timer.start();
timer.suspend();

add(gameScr);

Panel rightScr = new Panel();
rightScr.setLayout(new GridLayout(2,1,0,30));
rightScr.setSize(120,500);
add(rightScr);

//右邊信息窗體的布局
MyPanel infoScr = new MyPanel();
infoScr.setLayout(new GridLayout(4,1,0,5));
infoScr.setSize(120,300);
rightScr.add(infoScr);

//定義標簽和初始值
Label scorep = new Label("分數:",Label.LEFT);
Label levelp = new Label("級數:",Label.LEFT);
scoreField = new TextField(8);
levelField = new TextField(8);
scoreField.setEditable(false);
levelField.setEditable(false);
infoScr.add(scorep);
infoScr.add(scoreField);
infoScr.add(levelp);
infoScr.add(levelField);
scorep.setSize(new Dimension(20,60));
scoreField.setSize(new Dimension(20,60));
levelp.setSize(new Dimension(20,60));
levelField.setSize(new Dimension(20,60));
scoreField.setText("0");
levelField.setText("1");

//右邊控制按鈕窗體的布局
MyPanel controlScr = new MyPanel();
controlScr.setLayout(new GridLayout(5,1,0,5));
rightScr.add(controlScr);

//定義按鈕play
Button play_b = new Button("開始游戲");
play_b.setSize(new Dimension(50,200));
play_b.addActionListener(new Command(Command.button_play,gameScr));

//定義按鈕Level UP
Button level_up_b = new Button("提高級數");
level_up_b.setSize(new Dimension(50,200));
level_up_b.addActionListener(new Command(Command.button_levelup,gameScr));

//定義按鈕Level Down
Button level_down_b =new Button("降低級數");
level_down_b.setSize(new Dimension(50,200));
level_down_b.addActionListener(new Command(Command.button_leveldown,gameScr));

//定義按鈕Level Pause
Button pause_b =new Button("游戲暫停");
pause_b.setSize(new Dimension(50,200));
pause_b.addActionListener(new Command(Command.button_pause,gameScr));

//定義按鈕Quit
Button quit_b = new Button("退出遊戲");
quit_b.setSize(new Dimension(50,200));
quit_b.addActionListener(new Command(Command.button_quit,gameScr));

controlScr.add(play_b);
controlScr.add(level_up_b);
controlScr.add(level_down_b);
controlScr.add(pause_b);
controlScr.add(quit_b);
setVisible(true);
gameScr.requestFocus();
}
}

//重寫MyPanel類,使Panel的四周留空間
class MyPanel extends Panel{
public Insets getInsets(){
return new Insets(30,50,30,50);
}
}

//游戲畫布類
class GameCanvas extends Canvas implements KeyListener{
final int unitSize = 30; //小方塊邊長
int rowNum; //正方格的行數
int columnNum; //正方格的列數
int maxAllowRowNum; //允許有多少行未削
int blockInitRow; //新出現塊的起始行坐標
int blockInitCol; //新出現塊的起始列坐標
int [][] scrArr; //屏幕數組
Block b; //對方快的引用

//畫布類的構造方法
GameCanvas(){
rowNum = 15;
columnNum = 10;
maxAllowRowNum = rowNum - 2;
b = new Block(this);
blockInitRow = rowNum - 1;
blockInitCol = columnNum/2 - 2;
scrArr = new int [32][32];
}

//初始化屏幕,並將屏幕數組清零的方法
void initScr(){
for(int i=0;i<rowNum;i++)
for (int j=0; j<columnNum;j++)
scrArr[j]=0;
b.reset();
repaint();
}

//重新刷新畫布方法
public void paint(Graphics g){
for(int i = 0; i < rowNum; i++)
for(int j = 0; j < columnNum; j++)
drawUnit(i,j,scrArr[j]);
}

//畫方塊的方法
public void drawUnit(int row,int col,int type){
scrArr[row][col] = type;
Graphics g = getGraphics();
tch(type){ //表示畫方快的方法
case 0: g.setColor(Color.black);break; //以背景為顏色畫
case 1: g.setColor(Color.blue);break; //畫正在下落的方塊
case 2: g.setColor(Color.magenta);break; //畫已經落下的方法
}
g.fill3DRect(col*unitSize,getSize().height-(row+1)*unitSize,unitSize,unitSize,true);
g.dispose();
}

public Block getBlock(){
return b; //返回block實例的引用
}

//返回屏幕數組中(row,col)位置的屬性值
public int getScrArrXY(int row,int col){
if (row < 0 || row >= rowNum || col < 0 || col >= columnNum)
return(-1);
else
return(scrArr[row][col]);
}

//返回新塊的初始行坐標方法
public int getInitRow(){
return(blockInitRow); //返回新塊的初始行坐標
}

//返回新塊的初始列坐標方法
public int getInitCol(){
return(blockInitCol); //返回新塊的初始列坐標
}

//滿行刪除方法
void deleteFullLine(){
int full_line_num = 0;
int k = 0;
for (int i=0;i<rowNum;i++){
boolean isfull = true;

L1:for(int j=0;j<columnNum;j++)
if(scrArr[j] == 0){
k++;
isfull = false;
break L1;
}
if(isfull) full_line_num++;
if(k!=0 && k-1!=i && !isfull)
for(int j = 0; j < columnNum; j++){
if (scrArr[j] == 0)
drawUnit(k-1,j,0);
else
drawUnit(k-1,j,2);
scrArr[k-1][j] = scrArr[j];
}
}
for(int i = k-1 ;i < rowNum; i++){
for(int j = 0; j < columnNum; j++){
drawUnit(i,j,0);
scrArr[j]=0;
}
}
ERS_Block.score += full_line_num;
ERS_Block.scoreField.setText(""+ERS_Block.score);
}

//判斷游戲是否結束方法
boolean isGameEnd(){
for (int col = 0 ; col <columnNum; col ++){
if(scrArr[maxAllowRowNum][col] !=0)
return true;
}
return false;
}

public void keyTyped(KeyEvent e){
}

public void keyReleased(KeyEvent e){
}

//處理鍵盤輸入的方法
public void keyPressed(KeyEvent e){
if(!ERS_Block.isPlay)
return;
tch(e.getKeyCode()){
case KeyEvent.VK_DOWN:b.fallDown();break;
case KeyEvent.VK_LEFT:b.leftMove();break;
case KeyEvent.VK_RIGHT:b.rightMove();break;
case KeyEvent.VK_SPACE:b.leftTurn();break;
}
}
}

//處理控制類
class Command implements ActionListener{
static final int button_play = 1; //給按鈕分配編號
static final int button_levelup = 2;
static final int button_leveldown = 3;
static final int button_quit = 4;
static final int button_pause = 5;
static boolean pause_resume = true;

int curButton; //當前按鈕
GameCanvas scr;

//控制按鈕類的構造方法
Command(int button,GameCanvas scr){
curButton = button;
this.scr=scr;
}

//按鈕執行方法
public void actionPerformed (ActionEvent e){
tch(curButton){
case button_play:if(!ERS_Block.isPlay){
scr.initScr();
ERS_Block.isPlay = true;
ERS_Block.score = 0;
ERS_Block.scoreField.setText("0");
ERS_Block.timer.resume();
}
scr.requestFocus();
break;
case button_levelup:if(ERS_Block.level < 10){
ERS_Block.level++;
ERS_Block.levelField.setText(""+ERS_Block.level);
ERS_Block.score = 0;
ERS_Block.scoreField.setText(""+ERS_Block.score);
}
scr.requestFocus();
break;
case button_leveldown:if(ERS_Block.level > 1){
ERS_Block.level--;
ERS_Block.levelField.setText(""+ERS_Block.level);
ERS_Block.score = 0;
ERS_Block.scoreField.setText(""+ERS_Block.score);
}
scr.requestFocus();
break;
case button_pause:if(pause_resume){
ERS_Block.timer.suspend();
pause_resume = false;
}else{
ERS_Block.timer.resume();
pause_resume = true;
}
scr.requestFocus();
break;
case button_quit:System.exit(0);
}
}
}

//方塊類
class Block {
static int[][] pattern = {
{0x0f00,0x4444,0x0f00,0x4444},//用十六進至表示,本行表示長條四種狀態
{0x04e0,0x0464,0x00e4,0x04c4},
{0x4620,0x6c00,0x4620,0x6c00},
{0x2640,0xc600,0x2640,0xc600},
{0x6220,0x1700,0x2230,0x0740},
{0x6440,0x0e20,0x44c0,0x8e00},
{0x0660,0x0660,0x0660,0x0660}
};
int blockType; //塊的模式號(0-6)
int turnState; //塊的翻轉狀態(0-3)
int blockState; //快的下落狀態
int row,col; //塊在畫布上的坐標
GameCanvas scr;

//塊類的構造方法
Block(GameCanvas scr){
this.scr = scr;
blockType = (int)(Math.random() * 1000)%7;
turnState = (int)(Math.random() * 1000)%4;
blockState = 1;
row = scr.getInitRow();
col = scr.getInitCol();
}

//重新初始化塊,並顯示新塊
public void reset(){
blockType = (int)(Math.random() * 1000)%7;
turnState = (int)(Math.random() * 1000)%4;
blockState = 1;
row = scr.getInitRow();
col = scr.getInitCol();
dispBlock(1);
}

//實現「塊」翻轉的方法
public void leftTurn(){
if(assertValid(blockType,(turnState + 1)%4,row,col)){
dispBlock(0);
turnState = (turnState + 1)%4;
dispBlock(1);
}
}

//實現「塊」的左移的方法
public void leftMove(){
if(assertValid(blockType,turnState,row,col-1)){
dispBlock(0);
col--;
dispBlock(1);
}
}

//實現塊的右移
public void rightMove(){
if(assertValid(blockType,turnState,row,col+1)){
dispBlock(0);
col++;
dispBlock(1);
}
}

//實現塊落下的操作的方法
public boolean fallDown(){
if(blockState == 2)
return(false);
if(assertValid(blockType,turnState,row-1,col)){
dispBlock(0);
row--;
dispBlock(1);
return(true);
}else{
blockState = 2;
dispBlock(2);
return(false);
}
}

//判斷是否正確的方法
boolean assertValid(int t,int s,int row,int col){
int k = 0x8000;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
if((int)(pattern[t][s]&k) != 0){
int temp = scr.getScrArrXY(row-i,col+j);
if (temp<0||temp==2)
return false;
}
k = k >> 1;
}
}
return true;
}

//同步顯示的方法
public synchronized void dispBlock(int s){
int k = 0x8000;
for (int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
if(((int)pattern[blockType][turnState]&k) != 0){
scr.drawUnit(row-i,col+j,s);
}
k=k>>1;
}
}
}
}

//定時線程
class MyTimer extends Thread{
GameCanvas scr;

public MyTimer(GameCanvas scr){
this.scr = scr;
}

public void run(){
while(true){
try{
sleep((10-ERS_Block.level + 1)*100);
}
catch(InterruptedException e){}
if(!scr.getBlock().fallDown()){
scr.deleteFullLine();
if(scr.isGameEnd()){
ERS_Block.isPlay = false;
suspend();
}else
scr.getBlock().reset();
}
}
}
}

class WinListener extends WindowAdapter{
public void windowClosing (WindowEvent l){
System.exit(0);
}
}

Ⅱ 小游戲程序設計代碼內容

http://www.pudn.com/

[我的早期C程序源代碼]黑白棋

#include<io.h>
#include<stdio.h>
#include<dos.h>
#include<string.h>
#include<math.h>
#include<bios.h>
#include<mem.h>
#include<fcntl.h>
#include<stdlib.h>
#include<conio.h>
#include <graphics.h>

#define HH '0'
#define N 6
int Q=0;
char key;
int fine=1;
int A=0,B=0;
char s[N][N],m[N][N];
void *ball;
int maxx;
unsigned int size;
loading()
{ int z=1;

while(z)
{ if(z>77)break;
printf("<");
delay(5000);
z++;
}
delay(2000);
cleardevice();

}
unsigned char Get_Ascii_Key(void)
{
if(bioskey(1))
return(bioskey(0));
else return(0);
}
int Test_Ascii_Key(int ascii)
{
if(Get_Ascii_Key()==ascii)
return(1);
else
return(0);
}
void tu(){
maxx=getmaxx();
size=imagesize(210,390,450,420);
ball=malloc(size);
setfillstyle(1,10);
bar(160,170,473,253);
setfillstyle(1,9);
bar(163,173,470,250);
setcolor(13);
outtextxy(200,200,"Welcome to BLACK & WHITE chess");
setcolor(14);
outtextxy(250,220,"Developer :Wu siyuan ");
outtextxy(290,240,"2002.8");
outtextxy(210,390,"Press any key to contunue...");
getimage(210,390,450,420,ball);

while(!kbhit()){
putimage(210,390,ball,XOR_PUT);
delay(30000);
}

cleardevice();
}
void sou(void){

}
void print()
{ int i=0,j=30;
setcolor(11);
outtextxy(35,20," 0 1 2 3 4 5");
outtextxy(14,50,"0");
outtextxy(14,100,"1");
outtextxy(14,150,"2");
outtextxy(14,200,"3");
outtextxy(14,250,"4");
outtextxy(14,300,"5");
setbkcolor(0);
setlinestyle(SOLID_LINE,0,2);
for(i=0;i<7;i++)
{ setcolor(GREEN);
line (j,30,j,330);
j+=50;
}

j=30;
for(i=0;i<7;i++)
{ setcolor(GREEN);
line(30,j,330,j);
j+=50;

}
for(i=0;i<6;i++)
for(j=0;j<6;j++)
{ if(s[i][j]=='o')

{
setcolor(WHITE);
circle(55+j*50,55+i*50,15);
}
else if(s[i][j]=='x')
{ setcolor(RED);
circle(55+j*50,55+i*50,15); }
}

}

int cal(char z)
{ int *p=0;
int num=0,i,j;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
if(s[i][j]==z)num++;
p=#
return(*p);
}
void save()
{int i,j;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
m[i][j]=s[i][j];
}

void load()
{ int i,j;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
s[i][j]=m[i][j];
}

snew(int x,int y,char z1,char z2)
{int i,j,a;int can[]={0,0,0,0,0,0,0,0,0},k[N*N];
if(s[x][y-1]==z1&&(y-1)>=0)
{
i=0;
while(i<y)
{
if(s[x][i]==z2){ can[1]=1;break; }
i++;
}
}
if(s[x][y+1]==z1)
{
i=y+2;
while(i<N)
{
if(s[x][i]==z2){ can[2]=1;break;}
i++;
}
}
if(s[x-1][y]==z1&&(x-1)>=0)
{
i=0;
while(i<x)
{
if(s[i][y]==z2){can[3]=1;break;}
i++;
}
}
if(s[x+1][y]==z1)
{i=x+2;
while(i<N)
{
if(s[i][y]==z2){can[4]=1;break;}
i++;
}
}
if(s[x-1][y+1]==z1&&(x-1)>=0)
{i=2;
while(y+i<N&&(x-i>=0))
{if(s[x-i][y+i]==z2){can[5]=1;break;}
i++;
}
}
if(s[x+1][y-1]==z1&&(y-1)>=0)
{i=2;
while(i<N&&(y-i>=0))
{if(s[x+i][y-i]==z2)
{can[6]=1;break;}
i++;
}
}
if(s[x-1][y-1]==z1&&(x-1)*(y-1)>=0)
{i=2;
while(x-i>=0&&y-i>=0)
{if(s[x-i][y-i]==z2)
{can[7]=1;
break;}
i++;
}
}
if(s[x+1][y+1]==z1)
{i=2;
while(i+x<N)
{if(s[x+i][y+i]==z2)
{can[8]=1;
break;}
i++;
}
}
for(i=1,j=0;i<=8;i++)
if(can[i]==0)j++;

if(j==8&&Q==1)
{printf("error!");
exit(1); }
else if(j!=8)s[x][y]=z2;

if(can[1]==1)
{ i=1;
while(s[x][y-i]==z1)
{s[x][y-i]=z2;
i++;
}
can[1]=0;
}
if(can[2]==1)
{i=1;
while(s[x][y+i]==z1)
{s[x][y+i]=z2;
i++;
}
can[2]=0;
}
if(can[3]==1)
{i=1;
while(s[x-i][y]==z1)
{ s[x-i][y]=z2;
i++;
}
can[3]=0;
}
if(can[4]==1)
{i=1;
while(s[x+i][y]==z1)
{s[x+i][y]=z2;
i++;
}
can[4]=0;
}
if(can[5]==1)
{i=1;
while(s[x-i][y+i]==z1)
{s[x-i][y+i]=z2;
i++;
}
can[5]=0;
}
if(can[6]==1)
{i=1;
while(s[x+i][y-i]==z1)
{s[x+i][y-i]=z2;
i++;
}
can[6]=0;
}
if(can[7]==1)
{i=1;
while(s[x-i][y-i]==z1)
{s[x-i][y-i]=z2;
i++;
}
can[7]=0;
}
if(can[8]==1)
{i=1;
while(s[x+i][y+i]==z1)
{s[x+i][y+i]=z2;
i++;
}
can[8]=0;
}

} /* snew */

void one()
{ int a,b;char g='o';

load();
setcolor(15);
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\n To exit the Game press the 'q' key.\n");
print();

printf("Please input x (0 to 5):");
while(1){

a=Get_Ascii_Key();

if(a==113||a==81){
printf("\nQuit?(y or n)");
while(1)
{
if(Test_Ascii_Key(89)||Test_Ascii_Key(121))
exit(0);
else if(Test_Ascii_Key(110)||Test_Ascii_Key(78))
{printf("\n\tWelcome to return the Game !\n");break; }

}}

if(a>=48&&a<=53){printf("\tGood! x has get!\n");
break;}
}
a=a-48;
printf("Please input y (0 to 5):");

while(1){

b=Get_Ascii_Key();
if(b==113||b==81)
{
printf("\nQuit?(y or Y)");
while(1)
{
if(Test_Ascii_Key(89)||Test_Ascii_Key(121))
exit(0);
else if(Test_Ascii_Key(110)||Test_Ascii_Key(78))
break;

}}
if(b>=48&&a<=53){printf("\tGood! y has get!");break;}
}
b=b-48;

Q=1;
snew(a,b,'x','o');
Q=0;
save();

A=cal(g);
B=cal('x');
/* printf("\t\t\t\t\t\t\rA=%d,B=%d",A,B);*/

}/* one */
void search()
{
int i,j,r=0;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
if(s[i][j]==HH)
r++;
if(r==0)fine=0;

}
void two()
{ char h='x';int row[N*N],col[N*N];
int a=1,ii,j,t,t1,k[N*N];
load();
for(ii=0;ii<N;ii++)
for(j=0;j<N;j++)
if(s[ii][j]==HH)
{
row[a]=ii;
col[a]=j;
a++;
}
/* space right */

for(ii=1;ii<a;ii++)
{
load(); /*two*/
snew(row[ii],col[ii],'o','x');
k[ii]=cal(h);

}
t=k[1];
ii--;
t1=ii;
while(ii)
{
if(t<=k[ii])
{t=k[ii];t1=ii;}
ii--;
}

a=t1;
A=cal('o');
B=t;
load();

snew(row[a],col[a],'o','x');
save();
cleardevice();

printf("\n\n\t\t\t\t\t Computer located :%d,%d",row[a],col[a]);

}

main()
{ int i,j;
int gd=DETECT,gm;
clrscr();
initgraph(&gd,&gm,"d:\\tc\\bgi");

setbkcolor(BLACK);

tu();

sou();
setbkcolor(0);

for(i=0;i<N;i++)
for(j=0;j<N;j++)
s[i][j]='0';
s[2][2]=s[3][3]='x';
s[2][3]=s[3][2]='o';
save();
loading();
cleardevice();

while(fine)

{
print();
one();
two();
search();
if(key==113||key==81)
{
printf("\nQuit?(y or Y)");
while(!Test_Ascii_Key(89)&&!Test_Ascii_Key(121));
break;
}
}
if(A>B)outtextxy(400,200, " You win!");
else if(A<B)outtextxy(400,200," I win!");
else outtextxy(400,200," It's a draw!");
printf("\n You:%d I:%d",A,B);
getch();
}

Ⅲ 求黑白棋演算法

優先順序演算法(1-8)x( a-h)

對這64個格分別定義優先順序,優先順序高的先落子,同優先順序的(同優先順序的格子非常少)考慮吃子數。
演算法簡單極易實現,做的AI保證無敵。

當然 這64個格子的具體優先順序,需要精通黑白棋的人來分析了。

Ⅳ 五子棋源代碼html

js代碼:
定義canvas及黑白棋變數
<font color="#2f4f4f" face="微軟雅黑" size="3">var canvas;
var context;
var isWhite = true;//設置是否該輪到白棋
var isWell = false;//設置該局棋盤是否贏了,如果贏了就不能再走了
var img_b = new Image();
img_b.src = "images/b.png";//白棋圖片
var img_w = new Image();
img_w.src = "images/c.png";//黑棋圖片</font>
為棋盤的二維數組用來保存棋盤信息
<font color="#2f4f4f" face="微軟雅黑" size="3"> var chessData = new Array(15);//初始化0為沒有走過的,1為白棋走的,2為黑棋走的
for (var x = 0; x < 15; x++) {
chessData[x] = new Array(15);
for (var y = 0; y < 15; y++) {
chessData[x][y] = 0;
}
}</font>
繪制棋盤的線
<font color="#2f4f4f" face="微軟雅黑" size="3"> for (var i = 0; i <= 640; i += 40) {
context.beginPath();
context.moveTo(0, i);
context.lineTo(640, i);
context.closePath();
context.stroke();
context.beginPath();
context.moveTo(i, 0);
context.lineTo(i, 640);
context.closePath();
context.stroke();
}
}</font>
判斷該棋局的輸贏
<font color="#2f4f4f" face="微軟雅黑" size="3"> if (count1 >= 5 || count2 >= 5 || count3 >= 5 || count4 >= 5) {
if (chess == 1) {
alert("白棋贏了");
}
else {
alert("黑棋贏了");
}
isWell = true;//設置該局棋盤已經贏了,不可以再走了
}</font>
html代碼:
<font color="#2f4f4f" face="微軟雅黑" size="3"><body onload="drawRect()">
<div>
<canvas width="640" id="canvas" onmousedown="play(event)" height="640">你的瀏覽器不支持HTML5 canvas ,請使用 google chrome 瀏覽器 打開.
</canvas>
</div>
</body></font>

Ⅳ 高分求一個「黑白棋」的匯編源碼

//我這有個源代碼,不過是VC++的。你對照API就可以修改的。
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// Chinese (P.R.C.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
#ifdef _WIN32
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
#pragma code_page(936)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END

3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 4, 2\r\n"
"#pragma code_page(936)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\bw.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""l.chs\\afxres.rc"" // Standard components\r\n"
"#include ""l.chs\\afxprint.rc"" // printing/print preview resources\r\n"
"#endif\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\bw.ico"
IDR_BWTYPE ICON DISCARDABLE "res\\bwDoc.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//

IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
IDB_BOARD BITMAP DISCARDABLE "res\\board1.bmp"
IDB_EMPTY BITMAP DISCARDABLE "res\\empty.bmp"
IDB_WHITE BITMAP DISCARDABLE "res\\white.bmp"
IDB_BLACK BITMAP DISCARDABLE "res\\black.bmp"
IDB_LAST BITMAP DISCARDABLE "res\\bitmap1.bmp"

/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//

IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 16
BEGIN
BUTTON ID_BLACK
BUTTON ID_WHITE
BUTTON ID_REG
SEPARATOR
BUTTON ID_ONE
BUTTON ID_TWO
BUTTON ID_THREE
SEPARATOR
BUTTON ID_APP_ABOUT
END

/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDR_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "棋局(&F)"
BEGIN
MENUITEM "執黑先手(&B)\tCtrl+B", ID_BLACK
MENUITEM "執白後手(&W)\tCtrl+W", ID_WHITE
MENUITEM "悔棋(&S)\tCtrl+S", ID_REG
MENUITEM SEPARATOR
MENUITEM "退出(&X)", ID_APP_EXIT
END
POPUP "選項(&O)"
BEGIN
MENUITEM "低難度", ID_ONE
MENUITEM "中難度", ID_TWO
MENUITEM "高難度", ID_THREE
END
POPUP "查看(&V)"
BEGIN
MENUITEM "工具欄(&T)", ID_VIEW_TOOLBAR
MENUITEM "狀態欄(&S)", ID_VIEW_STATUS_BAR
END
POPUP "幫助(&H)"
BEGIN
MENUITEM "關於 黑白棋(&A)...", ID_APP_ABOUT
END
END

/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//

IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"N", ID_FILE_NEW, VIRTKEY, CONTROL
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
"P", ID_FILE_PRINT, VIRTKEY, CONTROL
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
VK_F6, ID_NEXT_PANE, VIRTKEY
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
END

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 223, 49
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "關於 黑白棋"
FONT 9, "宋體"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,21,21
LTEXT "黑白棋 ",IDC_STATIC,38,14,119,8,SS_NOPREFIX
LTEXT "版權所有 (C) 2002",IDC_STATIC,40,28,119,8
DEFPUSHBUTTON "確定",IDOK,166,7,50,14,WS_GROUP
END

#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080404b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "bw Microsoft 基礎類應用程序\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "bw\0"
VALUE "LegalCopyright", "版權所有 (C) 2001\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "bw.EXE\0"
VALUE "PrivateBuild", "\0"
VALUE "ProctName", "bw 應用程序\0"
VALUE "ProctVersion", "1, 0, 0, 1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x804, 1200
END
END

#endif // !_MAC

/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 216
TOPMARGIN, 7
BOTTOMMARGIN, 42
END
END
#endif // APSTUDIO_INVOKED

/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "黑白棋程序\n\nBw\n\n\nBw.Document\nBw Document"
END

STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE " "
AFX_IDS_IDLEMESSAGE "就緒"
END

STRINGTABLE DISCARDABLE
BEGIN
ID_INDICATOR_EXT "擴展名"
ID_INDICATOR_CAPS "大寫"
ID_INDICATOR_NUM "數字"
ID_INDICATOR_SCRL "滾動"
ID_INDICATOR_OVR "改寫"
ID_INDICATOR_REC "記錄"
END

STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_NEW " "
ID_FILE_OPEN " "
ID_FILE_CLOSE " "
ID_FILE_SAVE_AS " "
ID_FILE_PAGE_SETUP "改變列印選項\n頁面設置"
ID_FILE_PRINT_SETUP "改變列印機及列印選項\n列印設置"
ID_FILE_PRINT "列印活動文檔\n列印"
ID_FILE_PRINT_PREVIEW "顯示整頁\n列印預覽"
END

STRINGTABLE DISCARDABLE
BEGIN
ID_APP_ABOUT "顯示程序信息,版本號和版權\n關於"
ID_APP_EXIT "退出應用程序;提示保存文檔\n退出"
END

STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_MRU_FILE1 "打開該文檔"
ID_FILE_MRU_FILE2 "打開該文檔"
ID_FILE_MRU_FILE3 "打開該文檔"
ID_FILE_MRU_FILE4 "打開該文檔"
ID_FILE_MRU_FILE5 "打開該文檔"
ID_FILE_MRU_FILE6 "打開該文檔"
ID_FILE_MRU_FILE7 "打開該文檔"
ID_FILE_MRU_FILE8 "打開該文檔"
ID_FILE_MRU_FILE9 "打開該文檔"
ID_FILE_MRU_FILE10 "打開該文檔"
ID_FILE_MRU_FILE11 "打開該文檔"
ID_FILE_MRU_FILE12 "打開該文檔"
ID_FILE_MRU_FILE13 "打開該文檔"
ID_FILE_MRU_FILE14 "打開該文檔"
ID_FILE_MRU_FILE15 "打開該文檔"
ID_FILE_MRU_FILE16 "打開該文檔"
END

STRINGTABLE DISCARDABLE
BEGIN
ID_NEXT_PANE "切換到下一個窗格\n下一窗格"
ID_PREV_PANE "切換回前一個窗格\n前一窗格"
END

STRINGTABLE DISCARDABLE
BEGIN
ID_WINDOW_SPLIT "將活動的窗口分隔成窗格\n分隔"
END

STRINGTABLE DISCARDABLE
BEGIN
ID_EDIT_CLEAR "刪除被選對象\n刪除"
ID_EDIT_CLEAR_ALL "全部刪除\n全部刪除"
ID_EDIT_COPY " "
ID_EDIT_CUT " "
ID_EDIT_FIND "查找指定的正文\n查找"
ID_EDIT_PASTE " "
ID_EDIT_REPEAT "重復上一步操作\n重復"
ID_EDIT_REPLACE "用不同的正文替換指定的正文\n替換"
ID_EDIT_SELECT_ALL "選擇整個文檔\n選擇全部"
ID_EDIT_UNDO "撤消最後一步操作\n撤消"
ID_EDIT_REDO "重新執行先前已撤消的操作\n重新執行"
END

STRINGTABLE DISCARDABLE
BEGIN
ID_VIEW_TOOLBAR "顯示或隱藏工具欄\n顯隱工具欄"
ID_VIEW_STATUS_BAR "顯示或隱藏狀態欄\n顯隱狀態欄"
END

STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCSIZE "改變窗口大小"
AFX_IDS_SCMOVE "改變窗口位置"
AFX_IDS_SCMINIMIZE "將窗口縮小成圖標"
AFX_IDS_SCMAXIMIZE "把窗口放大到最大尺寸"
AFX_IDS_SCNEXTWINDOW "切換到下一個文檔窗口"
AFX_IDS_SCPREVWINDOW "切換到先前的文檔窗口"
AFX_IDS_SCCLOSE "關閉活動的窗口並提示保存所有文檔"
END

STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCRESTORE "把窗口恢復到正常大小"
AFX_IDS_SCTASKLIST "激活任務表"
END

STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_PREVIEW_CLOSE "關閉列印預覽模式\n取消預閱"
END

STRINGTABLE DISCARDABLE
BEGIN
ID_WHITE "執白後手"
ID_BLACK "執黑先手"
ID_REG "悔棋"
ID_ONE "低難度"
ID_THREE "高難度"
ID_TWO "中難度"
END

#endif // Chinese (P.R.C.) resources
/////////////////////////////////////////////////////////////////////////////

#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
#ifdef _WIN32
LANGUAGE 4, 2
#pragma code_page(936)
#endif //_WIN32
#include "res\bw.rc2" // non-Microsoft Visual C++ edited resources
#include "l.chs\afxres.rc" // Standard components
#include "l.chs\afxprint.rc" // printing/print preview resources
#endif

/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

熱點內容
安卓手機如何打開xp文件 發布:2024-11-29 08:27:46 瀏覽:949
戰歌腳本第二集 發布:2024-11-29 08:22:42 瀏覽:890
緩存清理是什麼意思 發布:2024-11-29 08:14:39 瀏覽:675
cvm伺服器搭建博客 發布:2024-11-29 08:03:42 瀏覽:889
魅族手機軟體怎麼加密 發布:2024-11-29 07:50:04 瀏覽:215
阿里雲伺服器託管合同 發布:2024-11-29 07:46:37 瀏覽:297
linux用戶許可權設置 發布:2024-11-29 07:43:39 瀏覽:271
c語言if函數嵌套 發布:2024-11-29 07:43:35 瀏覽:758
學編程L2 發布:2024-11-29 07:39:58 瀏覽:430
微信如何設置收與付密碼 發布:2024-11-29 07:39:15 瀏覽:542