㈠ 求用vc写的模拟烟花效果的源代码
关于 vc 里面使用 graphics.h 的问题,你只需要安装 easyx 即可,网络一下吧。另外你可以到网络 easyx 贴吧查找相关资源,官网也有使用演示。
关于图标的问题,你打开我的电脑 -> 工具 -> 文件夹选项 -> 文件类型,然后在里面修改 .c 和 .cpp 的图标即可。
㈡ 修仙家族模拟器物品代码
可以通过最新内置菜单开启功能后破解代码。
开启功能后输入代码,确定后再进入商店随机购买物品,到手的就是代码物品。例如,青莲剑诀中的代码是6081401,青莲剑诀下的代码是6081701,归元剑典中的代码是6081301,归元剑典中下的代码6081601等等。
一组数字就是一种装备排序,从高阶到低阶进行排序。
㈢ 求用C++做的"电梯模拟程序"的源代码
别人的东西,你看看吧
/*
* Elevator.h
* ElevatorAssignment
*
* Created by Isaac Huang on 08-6-23.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*
*/
class Elevator
{
private:
int WhichFloor;
public:
Elevator();
void ChangeFloor(int);
int GetFloor();
void Working();
};
/*
* Elevator.cpp
* ElevatorAssignment
*
* Created by Isaac Huang on 08-6-23.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*
*/
#include "Elevator.h"
#include <iostream.h>
Elevator::Elevator():WhichFloor(1){}
void Elevator::ChangeFloor(int num)
{
cout<<"Elevator Goes From "<<WhichFloor<<" To "<<num<<endl;
WhichFloor=num;
}
int Elevator::GetFloor()
{
return WhichFloor;
}
/*
* Building.h
* ElevatorAssignment
*
* Created by Isaac Huang on 08-6-23.
*
*/
#include "Floor.h"
#include "Elevator.h"
class Building
{
private:
Floor Floor1;
Floor Floor2;
Elevator Eleva;
int WorkTime;
public:
Building();
void Running(int);
void Print(int);
};
/*
* Building.cpp
* ElevatorAssignment
*
* Created by Isaac Huang on 08-6-23.
*
*/
#include "Building.h"
#include <stdlib.h>
#include <iostream.h>
#include <time.h>
Building::Building():Floor1(1),Floor2(2),WorkTime(0){}
void Building::Running(int OrderTime)
{
int i,iLater1=0,iLater2=0,Spent;
for(i=1;i<=OrderTime;i+=Spent)
{
Spent=1;
srand(time(0));
int Number1=5+rand()%16;
if((i-iLater1)==Number1)
{
Floor1.CreatePeople();
iLater1=i;
}
srand(time(0));
int Number2=5+rand()%16;
if((i-iLater2)==Number2)
{
Floor2.CreatePeople();
iLater2=i;
}
if(Eleva.GetFloor()==1)
{
if(Floor1.ReturnPeople()!=0)
{
Floor1.GetInside();
Eleva.ChangeFloor(2);
WorkTime++;
Spent=5;
Print(i+Spent);
}
else if(Floor2.ReturnPeople()!=0)
{
Eleva.ChangeFloor(2);
Floor2.GetInside();
Eleva.ChangeFloor(1);
WorkTime++;
Spent=10;
Print(i+Spent);
}
}
else if(Eleva.GetFloor()==2)
{
if(Floor2.ReturnPeople()!=0)
{
Floor2.GetInside();
Eleva.ChangeFloor(1);
WorkTime++;
Spent=5;
Print(i+Spent);
}
else if(Floor1.ReturnPeople()!=0)
{
Eleva.ChangeFloor(1);
Floor1.GetInside();
Eleva.ChangeFloor(2);
WorkTime++;
Spent=10;
Print(i+Spent);
}
}
}
//Print(OrderTime);
}
void Building::Print(int Time)
{
cout<<"Work Time: "<<Time<<"s"<<endl;
cout<<WorkTime<<" People Have Been Transported."<<endl;
cout<<"The Number Of People On The 1st Floor: "<<Floor1.ReturnPeople()<<endl;
cout<<"The Number Of People On The 2nd Floor: "<<Floor2.ReturnPeople()<<endl;
}
/*
* Floor.h
* ElevatorAssignment
*
* Created by Isaac Huang on 08-6-23.
*
*/
class Floor
{
private:
int FloorNumber;
int PeopleOnThisFloor;
public:
Floor(int);
void CreatePeople();
void GetInside();
int ReturnNumber();
int ReturnPeople();
};
/*
* Floor.cpp
* ElevatorAssignment
*
* Created by Isaac Huang on 08-6-23.
*
*/
#include "Floor.h"
Floor::Floor(int num):FloorNumber(num)
{
if(FloorNumber==1)
PeopleOnThisFloor=100;
else
PeopleOnThisFloor=100;
}
void Floor::CreatePeople()
{
PeopleOnThisFloor++;
}
int Floor::ReturnNumber()
{
return FloorNumber;
}
void Floor::GetInside()
{
PeopleOnThisFloor--;
}
int Floor::ReturnPeople()
{
return PeopleOnThisFloor;
}
#include "Building.h"
int main()
{
Building Sample;
Sample.Running(3600);
return 0;
}
㈣ 一个pc安卓模拟器是怎么开发出来的,有开源源码么
可以说没有,网上确实有IOS模拟器PC版,但是这个玩意是个IOS的SDK开发者方便在WINDOWS环境里开发调试IOS应用的,不会是你想想的那种用个这个模拟器就能直接安装IOS的应用或者游戏来玩了,这个直接运行不了,必须是源代码才能运行。不过你可以尝试用虚拟机安装苹果的MAC OS山狮系统。或者直接安装黑苹果。还有安卓模拟器的说法不准确。这个玩意应该叫安卓虚拟机。IOS你就别想了,不开源的系统是基本不可能你想象中的那种模拟器的。
㈤ 什么是仿真源代码
假如你的电脑里有个开关控制的电灯,你通过点击鼠标打开开关就可以使电脑里的电灯点亮,这就像现实的情况一样。如果你写程序的正确与否代表打开开关的动作,你写好的程序输入到电脑里,如果你的程序正确就能使电脑里的电灯亮否者就灭。就是说仿真是通过电脑模拟现实的情况。仿真源代码其实和源代码有时就是一样,只不过可能要适应某些不同的仿真软件而有修改。
㈥ 求一份c#商品模拟找零系统源码,老师的要求是,输入商品总金额(例如1546),输入所给金额(例如2
代码
classProgram
{
//人民币面额
privatestaticdecimal[]moneyArr=newdecimal[]{100M,50M,20M,10M,5M,2M,1M,0.5M,0.2M,0.1M,0.05M,0.02M,0.01M};
//存各种面额的人民币发放份数
privatestaticint[]moneyCountList=null;
staticvoidMain(string[]args)
{
decimalcurrentMoney=188.88M;
int[]moneyCount=Calculate(currentMoney);
Console.WriteLine("当前需找零金额:{0}¥",currentMoney);
for(inti=0;i<moneyCount.Length;i++)
Console.WriteLine("面额{0}¥共{1}张",moneyArr[i],moneyCount[i]);
Console.ReadLine();
}
///<summary>
///计算发放金额数
///</summary>
///<paramname="money"></param>
///<returns></returns>
staticint[]Calculate(decimalmoney)
{
moneyCountList=newint[]{0,0,0,0,0,0,0,0,0,0,0,0,0};
inttmpMoney=NumHelper(money);
while(tmpMoney>0)
{
for(inti=0;i<moneyArr.Length;i++)
{
if(tmpMoney>=NumHelper(moneyArr[i]))
{
intresult=tmpMoney/NumHelper(moneyArr[i]);//直接除,比一条一条减算的快
moneyCountList[i]=result;//对应的发送份数
tmpMoney=tmpMoney%NumHelper(moneyArr[i]);//余数
break;
}
}
}
returnmoneyCountList;
}
///<summary>
///将金钱转换成整数处理
///</summary>
///<paramname="money"></param>
///<returns></returns>
staticintNumHelper(decimalmoney)
{
returnConvert.ToInt32(money*100);
}
}
㈦ 怎么用c语言模拟写发52张扑克牌,求源码
代码很长 就不打了
思路就是做一个数组
比如
int a[4][13];
代表四个人
然后 1~52 这52个数 代表牌
定义int a[52];
初始化为0 表示牌是否发出去
然后用rand()%52+1获取随机数 如果没发出去的 那么 分配给对应人。
㈧ Mame模拟器的source code文件是做什么用的,怎么用
source code源代码
程序员用开发工具所支持的语言写出来的源文件
像MAMEPLUS!就是MAME爱好者用源代码重新编译的
源代码是给编程人员准备的,
如果你是编程人员你自然会知道那些东西是什么
如果你不是的话,请无视那些东西1
㈨ 易语言后台模拟鼠标、键盘的模块或者源码
不能用是因为人家游戏用API把你的模拟按键功能和谐了...解决方法:网络 易语言 驱动键盘模拟(其实驱动级的模拟就是直接模拟你鼠标和键盘的操作,自然也无法和谐....超级模块里有不同的模拟按键方式,你也可以一个个的试过去-_-!)
㈩ 求用C语言模拟简单台球运动的源代码,不需要图形化界面
这源代码应该有个桌面类(Table),球类(Sphere),游戏类等等。我用C++
#pragma once (Table.h)
#endif // _MSC_VER > 1000
#include "Base.h"
#define MESH_D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1)
class CTable:public CBase
{
public:
DWORD Render();
CTable(LPDIRECT3DDEVICE8 pD3DDevice,LPSTR pFilename);
virtual ~CTable();
LPD3DXMESH GetMeshTablePointer();
private:
void TransformTable();
LPDIRECT3DDEVICE8 m_pD3DDevice;
DWORD m_dwNumMaterials;
LPD3DXMESH m_pMeshTable;
D3DMATERIAL8 *m_pMeshTableMaterials;
LPDIRECT3DTEXTURE8 *m_pMeshTableTextures;
};#endif
#include "Table.h" (Table.cpp)
CTable::CTable(LPDIRECT3DDEVICE8 pD3DDevice,LPSTR pFilename)
{
LPD3DXBUFFER pMaterialsBuffer=NULL;
LPD3DXMESH pMeshTable=NULL;
m_pD3DDevice=pD3DDevice;
if(FAILED(D3DXLoadMeshFromX(pFilename,D3DXMESH_MANAGED,m_pD3DDevice,NULL,
&pMaterialsBuffer,&m_dwNumMaterials,&pMeshTable)))
{
m_pMeshTable=NULL;
m_pMeshTableMaterials=NULL;
m_pMeshTableTextures=NULL;
LogError("<li>Table Mesh '%s' failed to load",pFilename);
return;
}
D3DXMATERIAL *matMaterials=(D3DXMATERIAL*)pMaterialsBuffer->GetBufferPointer();
//Create two arrays. One to hold the materials and one to hold the textures
m_pMeshTableMaterials=new D3DMATERIAL8[m_dwNumMaterials];
m_pMeshTableTextures=new LPDIRECT3DTEXTURE8[m_dwNumMaterials];
for(DWORD i=0;i<m_dwNumMaterials;i++)
{
//Copy the material
m_pMeshTableMaterials[i]=matMaterials[i].MatD3D;
//Set the ambient color for the material(D3DX does not do this)
m_pMeshTableMaterials[i].Ambient=m_pMeshTableMaterials[i].Diffuse;
D3DCOLORVALUE rgbaSpecular={0.0f,0.0f,0.0f,0.0f};
m_pMeshTableMaterials[i].Specular=rgbaSpecular;
m_pMeshTableMaterials[i].Power=50.0f;
//Create the texture
char buffer[255];
sprintf(buffer,"textures/%s",matMaterials[i].pTextureFilename);
if(FAILED(D3DXCreateTextureFromFile(m_pD3DDevice,
buffer, &m_pMeshTableTextures[i])))
{
m_pMeshTableTextures[i]=NULL;
}
}
//finished with the material buffer,so release it
SafeRelease(pMaterialsBuffer);
//Make sure that the normals are setup for mesh
pMeshTable->CloneMeshFVF(D3DXMESH_MANAGED,MESH_D3DFVF_CUSTOMVERTEX,m_pD3DDevice,&m_pMeshTable);
SafeRelease(pMeshTable);
// D3DXComputeNormals(m_pMesh);
LogInfo("<li>Mesh '%s' loaded OK",pFilename);
}
CTable::~CTable()
{
SafeDelete(m_pMeshTableMaterials);
if(m_pMeshTableTextures != NULL)
{
for(DWORD i=0;i<m_dwNumMaterials;i++)
{
if(m_pMeshTableTextures[i])
SafeRelease(m_pMeshTableTextures[i]);
}
}
SafeDelete(m_pMeshTableTextures);
SafeRelease(m_pMeshTable);
LogInfo("<li>Table Mesh destroyed OK");
}
DWORD CTable::Render()
{
TransformTable();
if(m_pMeshTable!=NULL)
{
for(DWORD i=0;i<m_dwNumMaterials;i++)
{
m_pD3DDevice->SetMaterial(&m_pMeshTableMaterials[i]);
m_pD3DDevice->SetTexture(0,m_pMeshTableTextures[i]);
m_pMeshTable->DrawSubset(i);
}
return m_pMeshTable->GetNumFaces();
}
else
return 0;
}
LPD3DXMESH CTable::GetMeshTablePointer()
{
return m_pMeshTable;
}
void CTable::TransformTable()
{
D3DXMATRIX matWorld;
D3DXMatrixTranslation(&matWorld,0,0,0);
m_pD3DDevice->SetTransform(D3DTS_WORLD,&matWorld);
}
(Sphere.h)
#if !defined (AFX_SPHERE_H__FC705F3B_568E_4973_B608_B8F7700D9ECE__INCLUDED_)
#define AFX_SPHERE_H__FC705F3B_568E_4973_B608_B8F7700D9ECE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Base.h"
#define SPHERE_D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1)
class CSphere:public CBase
{
private:
struct SPHERE_CUSTOMVERTEX
{
float x,y,z; //Position of vertex in 3D space
float nx,ny,nz; //Lighting Normal
float tu,tv; //Texture coordinates
};
struct SPHERE_STATE
{
D3DXVECTOR3 sVector; //Position of Centigram in 3D space
D3DXVECTOR3 vVector; //Direction of Velocity in 3D space
float v; //Speed of Sphere
};
SPHERE_STATE *m_pSphereState;
D3DXVECTOR3 m_vecSavePosition; //Save sphere position for collision bar
D3DXVECTOR3 m_vecSavePosition2; //Save sphere position for collision sphere
public:
BOOL SetMaterial(D3DCOLORVALUE rgbaDiffuse,D3DCOLORVALUE rgbaAmbient,
D3DCOLORVALUE rgbaSpecular,D3DCOLORVALUE rgbaEmissive,float rPower);
BOOL SetTexture(const char* szTextureFilePath);
DWORD Render();
CSphere(LPDIRECT3DDEVICE8 pD3DDevice,int iRings=20,int iSegments=20);
void MoveSphere();
void MoveSphereForUser(float x,float z);
virtual ~CSphere();
inline void SetSpherePosition(float x,float y,float z)
{
m_pSphereState->sVector.x=x;
m_pSphereState->sVector.y=y;
m_pSphereState->sVector.z=z;
};
inline void GetSpherePosition(D3DXVECTOR3 &vecSpherePos)
{
vecSpherePos=m_pSphereState->sVector;
};
inline void GetSavedSpherePosition(D3DXVECTOR3 &vecSavedSpherePos)
{
vecSavedSpherePos=m_vecSavePosition;
};
inline void GetSavedSpherePosition2(D3DXVECTOR3 &vecSavedSpherePos)
{
vecSavedSpherePos=m_vecSavePosition2;
};
inline void SaveSpherePosition()
{
m_vecSavePosition=m_pSphereState->sVector;
};
inline void SaveSpherePosition2()
{
m_vecSavePosition2=m_pSphereState->sVector;
};
inline void ContradictoryZv()
{
m_pSphereState->vVector.z=-m_pSphereState->vVector.z;
};
inline void ContradictoryXv()
{
m_pSphereState->vVector.x=-m_pSphereState->vVector.x;
};
void MirrorVAoubtAxis(D3DXVECTOR3 &n);
inline void ReceSphereVelocity(float percent)
{
m_pSphereState->v=m_pSphereState->v*percent;
};
inline float CheckSphereEnergy()
{
return m_pSphereState->v;
};
inline void SetSphereVelocityDir(const D3DXVECTOR3 &vDir)
{
m_pSphereState->vVector=vDir;
};
inline void SetSphereVelocity(const float &velocity)
{
m_pSphereState->v=velocity;
};
inline void GetSphereVelocityDir(D3DXVECTOR3 &vDir)
{
vDir=m_pSphereState->vVector;
};
inline float GetSphereVelocity()
{
return m_pSphereState->v;
};
inline void SetSphereStateToFalse()
{
m_bSphereInUse=FALSE;
};
inline void SetSphereStateToTrue()
{
m_bSphereInUse=TRUE;
};
inline BOOL GetSphereState()
{
return m_bSphereInUse;
};
void SetSphereVelocityAt_Y_NegativeAxis();
inline float GetSpherePosAt_Y_Axis()
{
return m_pSphereState->sVector.y;
};
private:
BOOL CreateIndexBuffer();
BOOL UpdateVertices();
BOOL CreateVertexBuffer();
void TransformSphere();
void TransformSphereForUser();
void UpdateSpherePosition();
void FrictionReseVelocity();
LPDIRECT3DDEVICE8 m_pD3DDevice;
LPDIRECT3DVERTEXBUFFER8 m_pVertexBuffer;
LPDIRECT3DTEXTURE8 m_pTexture;
D3DMATERIAL8 m_matMaterial;
LPDIRECT3DINDEXBUFFER8 m_pIndexBuffer;
int m_iRings;
int m_iSegments;
float m_fTotalDis;
D3DXVECTOR3 m_vecSphereRotationAxis;
BOOL m_bSphereInUse;
DWORD m_dwNumOfVertices;
DWORD m_dwNumOfIndices;
DWORD m_dwNumOfPolygons;
};#endif