5*5數字拼圖

Home Home
引用 | 編輯 ice-m6
2007-04-23 18:08
樓主
推文 x0
期末的作業哪上來和大家分享吧
寫的不是很好大家多多見諒
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
#define N 3
void make_array(void);
void put_array(void);
int a;

void main(void)
{
     int i,j,c,f,temp;
     char xy;
     make_array();                                          //做出亂數陣列
     printf("請用w、s、a、d來代表上下左右來移動\n");
     do{
           for(i=0;i<N;i++)
           {
                 for(j=0;j<N;j++)
                 {
                       if(a==9)         //找出空格的所在
                       {
                             xy=getch();      
                             if(xy==97)                        //如果按4的話跟右邊的交換
                             {                  
                                   f=j+1;                        
                                   if(f>2)                        //如果是最旁邊了會跳出
                                   {
                                         printf("他已是最邊邊了請換個方向吧\n");
                                         put_array();
                                         break;
                                   }
                                   else                        //如果不是最邊邊兩邊互換
                                   {
                                         temp=a;
                                         a=a;
                                         a=temp;
                                         put_array();      //再列出陣列
                                         break;
                                   }
                             }
                             else if(xy==100)                  //如果按6的話跟左邊的交換
                             {
                                   f=j-1;
                                   if(f<0)
                                   {
                                         printf("他已是最邊邊了請換個方向吧\n");
                                         put_array();
                                         break;
                          ..

訪客只能看到部份內容,免費 加入會員



獻花 x0
引用 | 編輯 testbird2
2008-03-31 00:12
1樓
  
有沒有程式呀,可否直接提供呢?

感謝啦~~~~~~ 表情

獻花 x0
引用 | 編輯 kdliang03122
2008-04-26 14:41
2樓
  
stdafx.h ?
什麽文件? 表情

獻花 x0
引用 | 編輯 ATLer
2008-04-30 08:25
3樓
  
stdafx.h是vc生成的頭文件

獻花 x0
引用 | 編輯 a09000320
2008-08-31 14:15
4樓
  
好像不錯的一個程式
這可以直接玩嗎?

獻花 x0
引用 | 編輯 kevin11671
2008-10-25 17:59
5樓
  
表情 編譯有報錯!?
表情 表情 表情
我用的是DEV-C++
我有試過把VC的頭文件刪掉
還有把void main 改成 int main
但是我還沒看下面的錯誤
是DEV-C++ 的問題嗎??
解答一下??

獻花 x0
引用 | 編輯 overing
2008-10-25 21:36
6樓
  
引用vc的標頭檔就表示整份程式中有使用到該標頭檔中定義的項目
你只是把標頭檔拿掉當然解決不了問題
應該上網找找有沒有那份標頭檔能下載
或是找找dev cpp有沒有可以替代的標頭檔來用

獻花 x0
引用 | 編輯 ericbin
2009-01-15 07:43
7樓
  
很不錯的小程式!
下載來試看看囉!

獻花 x0
引用 | 編輯 kem
2009-01-26 02:41
8樓
  
程序精良,十分有趣,值得鼓勵。(已匯款1000雅幣,請查收。)

獻花 x0
引用 | 編輯 39721115
2009-12-12 17:46
9樓
  
請問可以提供可編譯的原始程式嗎?
本人是想用於專題請大大提供編譯原始程式?
我有C++Builder 6 和 Dev-C++兩款軟體

獻花 x0
引用 | 編輯 steven780413
2010-01-03 01:52
10樓
  
剛好我們的期末作業也要寫一個程式
拿來參考看看 感謝 表情

獻花 x0
引用 | 編輯 OK-MAN
2010-01-04 15:28
11樓
  
參考參考...學習中 表情

獻花 x0
引用 | 編輯 Inndy
2010-02-04 20:39
12樓
  
暈..
我用DevC++5(4.9.9.X)
沒有先看下去~哈
做的很好!
加油!! 表情

獻花 x0
引用 | 編輯 k7138
2011-03-25 06:45
13樓
  
複製貼上就可以了嗎

獻花 x0
引用 | 編輯 csr
2011-03-25 21:49
14樓
  
我用dev c++ 4992無法編譯成功
謝謝
stdafx.h如下
它是用在32位元的標頭檔
dev c++無法編譯
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
//     are changed infrequently
//

#if !defined(AFX_STDAFX_H__95A22328_E88B_4D3B_A685_BEA5355785AE__INCLUDED_)
#define AFX_STDAFX_H__95A22328_E88B_4D3B_A685_BEA5355785AE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN            // Exclude rarely-used stuff from Windows headers

#include <afxwin.h>       // MFC core and standard components
#include <afxext.h>       // MFC extensions
#include <afxdisp.h>     // MFC Automation classes
#include <afxdtctl.h>            // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>                  // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT


//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__95A22328_E88B_4D3B_A685_BEA5355785AE__INCLUDED_)

獻花 x0