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

📄 -一个c语言编写的箱子游戏.txt

📁 -一个C语言编写的箱子游戏
💻 TXT
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0032)http://wbco.pc163.com.cn/bc1.htm -->
<HTML><HEAD><TITLE>编程技巧-一个C语言编写的箱子游戏</TITLE>
<META http-equiv=Content-Language content=zh-cn>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId>
<SCRIPT language=JavaScript>var currentpos,timer;function initialize(){timer=setInterval("scrollwindow()",50);}function sc(){clearInterval(timer);}function scrollwindow(){currentpos=document.body.scrollTop;window.scroll(0,++currentpos);if (currentpos != document.body.scrollTop)sc();}document.onmousedown=scdocument.ondblclick=initialize</SCRIPT>

<STYLE type=text/css>A:link {
	COLOR: #009f00; TEXT-DECORATION: none
}
A:active {
	COLOR: #009f00; TEXT-DECORATION: none
}
A:visited {
	COLOR: #009f00; TEXT-DECORATION: none
}
A:hover {
	COLOR: #00b500; TEXT-DECORATION: underline
}
BODY {
	CURSOR: url('link.ani')
}
</STYLE>

<STYLE fprolloverstyle>A:hover {
	FONT-WEIGHT: bold
}
</STYLE>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<TABLE cellSpacing=0 cellPadding=0 width="74%" border=0>
  <TBODY>
  <TR>
    <TD width="100%"><A href="http://wbco.pc163.com.cn/index.htm"><IMG 
      height=17 src="编程技巧-一个C语言编写的箱子游戏.files/sy.gif" width=45 border=0></A><A 
      href="http://wbco.pc163.com.cn/news.htm"><IMG height=17 
      src="编程技巧-一个C语言编写的箱子游戏.files/NEWS1.gif" width=59 border=0></A><A 
      href="http://wbco.pc163.com.cn/computer-jx.htm"><IMG height=17 
      src="编程技巧-一个C语言编写的箱子游戏.files/Jx-top.gif" width=59 border=0></A><A 
      href="http://wbco.pc163.com.cn/cpark.htm"><IMG height=17 
      src="编程技巧-一个C语言编写的箱子游戏.files/Dlyd.gif" width=59 border=0></A><A 
      href="http://wbco.pc163.com.cn/jy.htm"><IMG height=17 
      src="编程技巧-一个C语言编写的箱子游戏.files/Jyzn.gif" width=59 border=0></A><A 
      href="http://wbco.pc163.com.cn/z-student.htm"><IMG height=17 
      src="编程技巧-一个C语言编写的箱子游戏.files/Zsqk.gif" width=59 border=0></A><A 
      href="http://wbco.pc163.com.cn/zy.htm"><IMG height=17 
      src="编程技巧-一个C语言编写的箱子游戏.files/Zyjs.gif" width=59 border=0></A><A 
      href="http://wbco.pc163.com.cn/bbs.htm"><IMG height=17 
      src="编程技巧-一个C语言编写的箱子游戏.files/Bbs.gif" width=59 border=0></A><A 
      href="http://wbco.pc163.com.cn/rec1.htm"><IMG height=17 
      src="编程技巧-一个C语言编写的箱子游戏.files/navi_dir9.gif" width=73 
  border=0></A></TD></TR></TBODY></TABLE>
<TABLE height=1 cellSpacing=0 cellPadding=0 width=770 border=0>
  <TBODY>
  <TR>
    <TD vAlign=top width=201 bgColor=#528feb height=65>
      <TABLE height=60 cellSpacing=0 cellPadding=0 width=115 border=0>
        <TBODY>
        <TR>
          <TD width=115><IMG height=65 
            src="编程技巧-一个C语言编写的箱子游戏.files/wbjxtb.gif" width=120 border=0> 
            <P> </P>
            <P><A href="http://wbco.pc163.com.cn/bc2.htm"><FONT color=#ffffff 
            size=2>万年历问题的Qbasic解决方法</FONT></A></P>
            <P><A href="http://wbco.pc163.com.cn/bc.htm"><FONT color=#ffffff 
            size=2>日历表的显示</FONT></A></P>
            <P> </P>
            <P> </P>
            <P> </P></TD></TR></TBODY></TABLE></TD>
    <TD vAlign=top width=633 height=1 rowSpan=2>
      <TABLE borderColor=#528feb height=12 cellSpacing=0 cellPadding=0 
      width="100%" border=0>
        <TBODY>
        <TR>
          <TD vAlign=top width="97%" bgColor=#528feb height=12 rowSpan=2><IMG 
            height=67 src="" width=630 border=0></TD>
          <TD vAlign=top width="3%" bgColor=#ffffff height=1><IMG height=14 
            src="" width=18 border=0></TD></TR>
        <TR>
          <TD vAlign=top width="3%" bgColor=#528feb height=53> </TD></TR>
        <TR>
          <TD vAlign=top width="100%" colSpan=2 height=586>
            <TABLE borderColor=#528feb height=604 cellSpacing=0 cellPadding=0 
            width="100%" border=1>
              <TBODY>
              <TR>
                <TD vAlign=top width="100%" height=604>
                  <TABLE height=574 cellSpacing=0 cellPadding=0 width="111%" 
                  border=0>
                    <TBODY>
                    <TR>
                      <TD vAlign=top width="7%" bgColor=#ffffff height=1><IMG 
                        height=28 src="" width=37 border=0></TD>
                      <TD vAlign=center width="93%" bgColor=#ffffff height=1>
                        <TABLE cellSpacing=0 cellPadding=0 width="100%" 
border=0>
                          <TBODY>
                          <TR>
                            <TD width="100%"><FONT color=#009f00 size=2><A 
                              href="http://wbco.pc163.com.cn/index.htm">首页</A>&gt;&gt;<A 
                              href="http://wbco.pc163.com.cn/cpark.htm">电脑园地</A>&gt;&gt;编程技巧&gt;&gt;一个C语言编写的箱子游戏&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                              </FONT><FONT color=#ff6c26 
                          size=2>双击自动滚屏</FONT></TD></TR></TBODY></TABLE></TD></TR>
                    <TR>
                      <TD vAlign=top borderColor=#008000 width="100%" colSpan=2 
                      height=1><IMG height=3 src="" width=489 border=0></TD></TR>
                    <TR>
                      <TD vAlign=top width="100%" colSpan=2 height=567>
                        <TABLE height=587 cellSpacing=0 cellPadding=0 
                        width="100%" border=0>
                          <TBODY>
                          <TR>
                            <TD vAlign=top width=650 
                            background=编程技巧-一个C语言编写的箱子游戏.files/Bgline2.gif 
                            height=19> </TD></TR>
                          <TR>
                            <TD vAlign=top width=650 height=505>
                              <TABLE height=520 cellSpacing=0 cellPadding=0 
                              width="100%" border=0>
                                <TBODY>
                                <TR>
                                <TD vAlign=top width="3%" 
                                background=编程技巧-一个C语言编写的箱子游戏.files/002.gif 
                                height=520> </TD>
                                <TD vAlign=top width="92%" 
                                background=编程技巧-一个C语言编写的箱子游戏.files/002.gif 
                                height=520>
                                <P align=center><FONT 
                                color=#000080>一个C语言编写的推箱子游戏</FONT></P>
                                <P><FONT size=2>/* 一个C语言编写的推箱子游戏源代码 */<BR>/* 
                                本游戏是字符模式的,请不要在中文dos下运行。本游戏在TURBO C下调试通过 
                                */<BR>#include &lt;dos.h&gt;<BR>#include 
                                &lt;stdio.h&gt;<BR>#include 
                                &lt;ctype.h&gt;<BR>#include 
                                &lt;conio.h&gt;<BR>#include 
                                &lt;bios.h&gt;<BR>#include 
                                &lt;alloc.h&gt;<BR><BR><BR>/* 
                                定义二维数组ghouse来记录屏幕上各点的状态,<BR>其中:0表示什么都没有,'b'表示箱子,'w'表示墙壁,'m'表示目的地,'i'表示箱子在目的地。 
                                */<BR>char ghouse[20][20];<BR><BR>/* 
                                以下函数为直接写屏函数,很酷的函数哦!是我朋友告诉我的。 */<BR>char far 
                                *screen=(char far* )0xb8000000;<BR>void 
                                putchxy(int y,int x,char ch,char fc,char 
                                bc)<BR>{<BR>screen[(x*160)+(y&lt;&lt;1)+0]=ch;<BR>screen[(x*160)+(y&lt;&lt;1)+1]=(bc*16)+fc;<BR>}<BR><BR>/* 
                                定义判断是否胜利的数据结构 */<BR>typedef struct winer 
                                {<BR>int x,y;<BR>struct winer 
                                *p;<BR>}winer;<BR><BR>/* 箱子位置的数据结构 */<BR>typedef 
                                struct boxs {<BR>int x,y;<BR>struct boxs 
                                *next;<BR>}boxs;<BR><BR>/* 在特定的坐标上画墙壁并用数组记录状态的函数 
                                */<BR>void printwall(int x,int 
                                y)<BR>{<BR>putchxy(y-1,x-1,219,GREEN,BLACK);<BR>ghouse[x][y]='w';<BR>}<BR><BR>/* 
                                在特定的坐标上画箱子并用数组记录状态的函数 */<BR>void printbox(int 
                                x,int 
                                y)<BR>{<BR>putchxy(y-1,x-1,10,WHITE,BLACK);<BR>ghouse[x][y]='b';<BR>}<BR><BR>/* 
                                在特定的坐标上画目的地并用数组记录状态的函数 */<BR>void 
                                printwhither1(int x,int y,winer **win,winer 
                                **pw)<BR>{<BR>winer 
                                *qw;<BR>putchxy(y-1,x-1,'*',YELLOW,BLACK);<BR>ghouse[x][y]='m';<BR>if(*win==NULL)<BR>{<BR>*win=*pw=qw=(winer* 
                                )malloc(sizeof(winer));<BR>(*pw)-&gt;x=x;(*pw)-&gt;y=y;(*pw)-&gt;p=NULL;<BR>}<BR>else<BR>{<BR>qw=(winer* 
                                )malloc(sizeof(winer));<BR>qw-&gt;x=x;qw-&gt;y=y;(*pw)-&gt;p=qw;(*pw)=qw;qw-&gt;p=NULL;<BR>}<BR>}<BR><BR><BR>/* 
                                在特定的坐标上画目的地并用数组记录状态的函数 */<BR>void 
                                printwhither(int x,int 
                                y)<BR>{<BR>putchxy(y-1,x-1,'*',YELLOW,BLACK);<BR>ghouse[x][y]='m';<BR>}<BR>/* 
                                在特定的坐标上画人的函数 */<BR>void printman(int x,int 
                                y)<BR>{<BR>gotoxy(y,x);<BR>_AL=02;_CX=01;_AH=0xa;<BR>geninterrupt(0x10);<BR>}<BR><BR>/* 
                                在特定的坐标上画箱子在目的地上并用数组记录状态的函数 */<BR>void 
                                printboxin(int x,int 
                                y)<BR>{<BR>putchxy(y-1,x-1,10,YELLOW,BLACK);<BR>ghouse[x][y]='i';<BR>}<BR><BR>/* 
                                初始化函数,初始化数组和屏幕 */<BR>void init()<BR>{<BR>int 

⌨️ 快捷键说明

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