求大神帮忙做个游戏编程 非常感谢 日语!!!

大神们帮帮小弟吧,求大神帮忙做个题【编程吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:194,104贴子:
大神们帮帮小弟吧,求大神帮忙做个题收藏
任意取九个数,若有两个数相等,视为一个数,则取十个数,最后取大小为中间的那个数输出,谢谢了
你可以去“百度之星技术社区”里面发帖求助一下,里面好多热情的大侠,很快能帮你解决的,我也在里面求助过,很快就有满意的回复的哦
这么简单 自己动手拉
登录百度帐号推荐应用求大神帮忙解决一个程序。谢谢了!!【编程吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:194,104贴子:
求大神帮忙解决一个程序。谢谢了!!收藏
第二题:set talk offclearfor n=1 to 10
a(n)=int(99*rand)nextfor i=i to 9for j=1 to 10-i
if a(j)&a(j+1)
a(j)=a(j+1)
a(j+1)=Tendifnext这道题的题目是把
if a(j)&a(j+1)
a(j)=a(j+1)
以上这部分程序改成选择排序和插入排序
登录百度帐号推荐应用求大神帮忙改游戏程序【计算机编程吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:7,902贴子:
求大神帮忙改游戏程序收藏
登录百度帐号推荐应用小白一枚。求大神帮忙【游戏编程吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:9,883贴子:
小白一枚。求大神帮忙收藏
老师布置一个作业,分析这个游戏程序,要用word做出来,求大神帮忙,#include &windowsx.h& #include &mmsystem.h&#include &iostream.h& // include important C/C++ stuff#include &conio.h&#include &stdlib.h&#include &malloc.h&#include &memory.h&#include &string.h&#include &stdarg.h&#include &stdio.h& #include &math.h&#include &io.h&#include &fcntl.h& #include &ddraw.h&
// directX includes#include &dsound.h&#include &dmksctrl.h&#include &dmusici.h&#include &dmusicc.h&#include &dmusicf.h&#include &dinput.h&#include &T3DLIB1.h& // game library includes#include &T3DLIB2.h&#include &T3DLIB3.h&// DEFINES //////////////////////////////////////////////// // defines for windows #define WINDOW_CLASS_NAME &WINXCLASS&
// class name #define WINDOW_WIDTH
// size of window#define WINDOW_HEIGHT
240 // PROTOTYPES ///////////////////////////////////////////// // game consoleint Game_Init(void *parms=NULL);int Game_Shutdown(void *parms=NULL);int Game_Main(void *parms=NULL); // GLOBALS //////////////////////////////////////////////// HWND main_window_handle
= NULL; // save the window handleHINSTANCE main_instance
= NULL; // save the instancechar buffer[80];
// used to print text BITMAP_IMAGE background_
// holds the background BOB
// the ai bat bob
// the player ghost bob static int ghost_anim[] = {0,1,2,1}; // animation sequence for ghost int bat_sound_id
// sound of bat flapping wings
wind_sound_id = -1;
// the ambient wind // FUNCTIONS ////////////////////////////////////////////// LRESULT CALLBACK WindowProc(HWND hwnd,
WPARAM wparam,
LPARAM lparam){// this is the main message handler of the systemPAINTSTRUCT
// used in WM_PAINTHDC
// handle to a device context // what is the message switch(msg){case WM_CREATE:
{// do initialization stuff herereturn(0);}
case WM_PAINT:
// start painting
hdc = BeginPaint(hwnd,&ps);
// end painting
EndPaint(hwnd,&ps);
return(0);
} case WM_DESTROY: {// kill the applicationPostQuitMessage(0);return(0);} default:
} // end switch // process any messages that we didn't take care of return (DefWindowProc(hwnd, msg, wparam, lparam)); } // end WinProc // WINMAIN //////////////////////////////////////////////// int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hprevinstance,LPSTR lpcmdline,int ncmdshow){// this is the winmain function WNDCLASS// this will hold the class we createHWND// generic window handleMSG// generic messageHDC
// generic dcPAINTSTRUCT
// generic paintstruct // first fill in the window class stucturewinclass.style= CS_DBLCLKS | CS_OWNDC |
CS_HREDRAW | CS_VREDRAW;winclass.lpfnWndProc= WindowPwinclass.cbClsExtra= 0;winclass.cbWndExtra= 0;winclass.hInstance=winclass.hIcon= LoadIcon(NULL, IDI_APPLICATION);winclass.hCursor= LoadCursor(NULL, IDC_ARROW);winclass.hbrBackground= (HBRUSH)GetStockObject(BLACK_BRUSH);winclass.lpszMenuName= NULL; winclass.lpszClassName= WINDOW_CLASS_NAME; // register the window classif (!RegisterClass(&winclass))return(0); // create the window, note the use of WS_POPUPif (!(hwnd = CreateWindow(WINDOW_CLASS_NAME, // class
&Tracking demo&, // title
WS_POPUP | WS_VISIBLE,
WINDOW_WIDTH,
WINDOW_HEIGHT, // height
// handle to parent
// handle to menu
hinstance,// instance
NULL)))// creation parmsreturn(0); // save the window handle and instance in a globalmain_window_handle =main_instance
= // perform all game console specific initializationGame_Init(); // enter main event loopwhile(1){if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)){ // test if this is a quit
if (msg.message == WM_QUIT)// translate any accelerator keysTranslateMessage(&msg); // send the message to the window procDispatchMessage(&msg);} // end if
// main game processing goes here
Game_Main(); } // end while // shutdown game and release all resourcesGame_Shutdown(); // return to Windows like thisreturn(msg.wParam); } // end WinMain // T3D GAME PROGRAMMING CONSOLE FUNCTIONS //////////////// int Game_Init(void *parms){// this function is where you do all the initialization // for your game
// looping variable // start up DirectDraw (replace the parms as you desire)DDraw_Init(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP); // load background imageLoad_Bitmap_File(&bitmap8bit, &GHOSTBACK.BMP&);Create_Bitmap(&background_bmp,0,0,640,480);Load_Image_Bitmap(&background_bmp, &bitmap8bit,0,0,BITMAP_EXTRACT_MODE_ABS);Set_Palette(bitmap8bit.palette);Unload_Bitmap_File(&bitmap8bit); // load the bat bitmapsLoad_Bitmap_File(&bitmap8bit, &BATS8_2.BMP&); // create bat bobCreate_BOB(&bat,320,200, 16,16, 5, BOB_ATTR_MULTI_FRAME | BOB_ATTR_VISIBLE, DDSCAPS_SYSTEMMEMORY);Set_Anim_Speed_BOB(&bat, 2); // load the bat in for (index=0; index & 5; index++)
Load_Frame_BOB(&bat, &bitmap8bit, index, index, 0, BITMAP_EXTRACT_MODE_CELL); // unload batUnload_Bitmap_File(&bitmap8bit); // load the ghost bitmapsLoad_Bitmap_File(&bitmap8bit, &GHOSTS8.BMP&); // create ghost bobCreate_BOB(&ghost,100,200, 64,100, 3, BOB_ATTR_MULTI_ANIM | BOB_ATTR_VISIBLE, DDSCAPS_SYSTEMMEMORY);Set_Anim_Speed_BOB(&ghost, 10); // load the ghost in for (index=0; index & 3; index++)
Load_Frame_BOB(&ghost, &bitmap8bit, index, index, 0, BITMAP_EXTRACT_MODE_CELL); // unload ghostUnload_Bitmap_File(&bitmap8bit); // set animation for ghostLoad_Animation_BOB(&ghost, 0, 4, ghost_anim); // set the animationSet_Animation_BOB(&ghost,0); // initialize directinputDInput_Init(); // acquire the keyboard onlyDInput_Init_Keyboard(); // initilize DirectSoundDSound_Init(); // load background soundsbat_sound_id = DSound_Load_WAV(&BAT.WAV&);wind_sound_id = DSound_Load_WAV(&WIND.WAV&); // start the soundsDSound_Play(bat_sound_id, DSBPLAY_LOOPING);DSound_Play(wind_sound_id, DSBPLAY_LOOPING); // set clipping rectangle to screen extents so objects dont// mess up at edgesRECT screen_rect = {0,0,screen_width,screen_height};lpddclipper = DDraw_Attach_Clipper(lpddsback,1,&screen_rect); // hide the mouseShowCursor(FALSE); // return successreturn(1); } // end Game_Init /////////////////////////////////////////////////////////// int Game_Shutdown(void *parms){// this function is where you shutdown your game and// release all resources that you allocated // shut everything down // kill all the bobsDestroy_BOB(&bat);Destroy_BOB(&ghost); // shutdown directdraw lastDDraw_Shutdown(); // now directsoundDSound_Stop_All_Sounds();DSound_Shutdown(); // shut down directinputDInput_Shutdown(); // return successreturn(1);} // end Game_Shutdown
////////////////////////////////////////////////////////// void Bat_AI(void){// this function performs the bat ai // do tracking algorithm // first x-axis
if (ghost.x & bat.x)
bat.x+=2;elseif (ghost.x & bat.x)
bat.x-=2; // now y-axisif (ghost.y & bat.y)
bat.y+=2;elseif (ghost.y & bat.y)
bat.y-=2; // check boundariesif (bat.x &= SCREEN_WIDTH)
bat.x = -bat.elseif (bat.x & -bat.width)
bat.x = SCREEN_WIDTH; if (bat.y &= SCREEN_HEIGHT)
bat.y = -bat.elseif (bat.y & -bat.height)
bat.y = SCREEN_HEIGHT; } // end Bat_AI ////////////////////////////////////////////////////////// int Game_Main(void *parms){// this is the workhorse of your game it will be called// continuously in real-time this is like main() in C// all the calls for you game go here!
// looping var // start the timing clockStart_Clock(); // clear the drawing surfaceDDraw_Fill_Surface(lpddsback, 0); // lock back buffer and copy background into itDDraw_Lock_Back_Surface(); // draw backgroundDraw_Bitmap(&background_bmp, back_buffer, back_lpitch,0); // unlock back surfaceDDraw_Unlock_Back_Surface(); // read keyboardDInput_Read_Keyboard(); // call the bat AIBat_AI(); // the animate the batAnimate_BOB(&bat); // draw the batDraw_BOB(&bat, lpddsback); // allow player to moveif (keyboard_state[DIK_RIGHT])
ghost.x+=4;elseif (keyboard_state[DIK_LEFT])
ghost.x-=4; if (keyboard_state[DIK_UP])
ghost.y-=4;elseif (keyboard_state[DIK_DOWN])
ghost.y+=4; // test if player is off screen, if so wrap aroundif (ghost.x &= SCREEN_WIDTH)
ghost.x = -ghost.elseif (ghost.x & -ghost.width)
ghost.x = SCREEN_WIDTH; if (ghost.y &= SCREEN_HEIGHT)
ghost.y = -ghost.elseif (ghost.y & -ghost.height)
ghost.y = SCREEN_HEIGHT; // the animate the ghostAnimate_BOB(&ghost); // draw the ghostDraw_BOB(&ghost, lpddsback); // draw titleDraw_Text_GDI(&GOING BATS! - Tracking Demo&,10, 10,RGB(0,255,0), lpddsback); // flip the surfacesDDraw_Flip(); // sync to 30ish fpsWait_Clock(30); // check of user is trying to exitif (KEY_DOWN(VK_ESCAPE) || keyboard_state[DIK_ESCAPE])
PostMessage(main_window_handle, WM_DESTROY,0,0);
// stop all sounds
DSound_Stop_All_Sounds();
// do a screen transition
Screen_Transitions(SCREEN_REDNESS,NULL,0);
} // end if // return successreturn(1); } // end Game_Main //////////////////////////////////////////////////////////
登录百度帐号推荐应用}

我要回帖

更多关于 中国编程大神 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信