资源简介
基于labview的贪吃蛇游戏。源代码,用labview编译实现!超经典!

代码片段和文件信息
/*
This program is designed to be built into a DLL and called from LabVIEW. Each function
that is marked DLLEXPORT can be called from third party code. These functions are
identical to the generate and sort example.
*/
#include // includes the ansi_c and windows libraries
#include
int __stdcall DllMain (HINSTANCE hinstDLL DWORD fdwReason LPVOID lpvReserved)
{ // main DLL function
return TRUE;
}
/*
The purpose of this function is to generate an array of random numbers of the size
ARRAYSIZE. Each number will be an integer between 0 and 100. The numbers are seeded
by time plus an offset. The array is passed into this function by reference
*/
void DLLEXPORT generateRand(int *iArray int ARRAYSIZE)
{
int i sTime;
time(&sTime); // gets time to seed the random number
for (i=0;i {
srand(sTime*100+i*10); // seeds each random from an offset of the time
iArray[i]=rand()*100/RAND_MAX; // inserts the random number into the array
}
}
/*
The purpose of this function is to sort an array of random numbers. This function
uses the bubblesort algorithm which has the time complexity O(n^2). The array
is passed into this function by reference.
*/
void DLLEXPORT bubbleSort(int *iArray int ARRAYSIZE)
{
int holder x y;
for(x = 0; x < ARRAYSIZE; x++)
{
for(y = 0; y < ARRAYSIZE-1; y++)
{
if(iArray[y] > iArray[y+1])
{ // compares neighboring elements and swaps if necessary
holder = iArray[y+1];
iArray[y+1] = iArray[y];
iArray[y] = holder;
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6915 2008-09-09 15:15 贪食蛇\Snake\ccw.vi
文件 13266 2008-09-09 15:15 贪食蛇\Snake\collision_self.vi
文件 6782 2008-09-09 15:15 贪食蛇\Snake\collision_wall.vi
文件 9921 2008-09-09 15:15 贪食蛇\Snake\next_move.vi
文件 16494 2013-01-05 15:44 贪食蛇\Snake\resolve_apples.vi
文件 45 2008-09-09 15:15 贪食蛇\Snake\snake.aliases
文件 2091 2006-10-31 14:31 贪食蛇\Snake\snake.ini
文件 4482 2008-09-09 15:15 贪食蛇\Snake\snake.lvproj
文件 43657 2008-09-09 15:17 贪食蛇\Snake\SNAKE.vi
文件 4623 2008-09-09 15:15 贪食蛇\Snake\xyplot.ctl
文件 8781 2013-01-05 15:44 贪食蛇\Snake\xyplot_delete.vi
文件 7693 2008-09-09 15:15 贪食蛇\Snake\xyplot_insert.vi
文件 206848 2008-04-09 15:51 贪食蛇\调用C-动态数据库\LabVIEW_code_and_DLL\GenSort.dll
文件 2648 2008-04-09 15:51 贪食蛇\调用C-动态数据库\LabVIEW_code_and_DLL\GenSort.lib
文件 18228 2008-04-09 15:57 贪食蛇\调用C-动态数据库\LabVIEW_code_and_DLL\GenSortRandC.vi
文件 1279 2008-04-04 10:47 贪食蛇\调用C-动态数据库\readme.txt
文件 206848 2008-04-09 15:51 贪食蛇\调用C-动态数据库\Source_code_for_dll\CVI Stuff\GenSort.dll
文件 2648 2008-04-09 15:51 贪食蛇\调用C-动态数据库\Source_code_for_dll\CVI Stuff\GenSort.lib
文件 1665 2004-01-12 12:07 贪食蛇\调用C-动态数据库\Source_code_for_dll\CVI Stuff\GenSortRand.c
文件 2866 2008-04-09 16:15 贪食蛇\调用C-动态数据库\Source_code_for_dll\CVI Stuff\GenSortRand.cws
文件 3904 2008-04-04 10:50 贪食蛇\调用C-动态数据库\Source_code_for_dll\CVI Stuff\GenSortRand.prj
文件 1699 2004-04-01 20:00 贪食蛇\调用C-动态数据库\Source_code_for_dll\Visual C++ Stuff\GenSort.cpp
文件 4309 2004-04-01 17:35 贪食蛇\调用C-动态数据库\Source_code_for_dll\Visual C++ Stuff\GenSort.dsp
文件 539 2004-04-01 20:39 贪食蛇\调用C-动态数据库\Source_code_for_dll\Visual C++ Stuff\GenSort.dsw
文件 50176 2004-04-02 00:30 贪食蛇\调用C-动态数据库\Source_code_for_dll\Visual C++ Stuff\GenSort.ncb
文件 48640 2004-04-02 00:30 贪食蛇\调用C-动态数据库\Source_code_for_dll\Visual C++ Stuff\GenSort.opt
文件 1739 2004-04-01 20:06 贪食蛇\调用C-动态数据库\Source_code_for_dll\Visual C++ Stuff\GenSort.plg
文件 1619 2004-04-01 17:35 贪食蛇\调用C-动态数据库\Source_code_for_dll\Visual C++ Stuff\MSVSReadMe.txt
文件 294 2004-04-01 17:35 贪食蛇\调用C-动态数据库\Source_code_for_dll\Visual C++ Stuff\StdAfx.cpp
文件 802 2004-04-01 17:35 贪食蛇\调用C-动态数据库\Source_code_for_dll\Visual C++ Stuff\StdAfx.h
............此处省略17个文件信息
- 上一篇:激光原理及应用电子教案 答案
- 下一篇:DAC 单片机程序
相关资源
- labview魔方程序
- 一个labview仿真的函数信号发生器.vi
- labview编程软件滤波器以及编写程序设
- labview语音输入输出
- labview中的DAQ助手采集多个通道电压
- 贪吃蛇源代码.fla
- Labview与CH372CH375的通信测试
- LabVIEW钢琴实例
- 贪吃蛇游戏设计(汇编语言)
- LabVIEW入门与实战开发100例190153
- LABVIEW做的蓝牙数据发送程序.vi
- 基于labview的变声器
- 基于labview的方差标准差计算(求方差
- smart和labview通讯(smart_connet.vi)
- Scratch 贪吃蛇 素材及代码
- LabVIEW 数据采集 模拟量+编码器(Daq
- LabVIEW 声音信号的采集与存储.vi
- LabVIEW步进电机控制.vi
- 多通道数据采集.vi(labview)
- Scratch 贪吃蛇 小游戏源码
- Scratch 好玩的贪吃蛇1.0
- labview智能电梯(6层电梯.vi)
- 用labview编写的一个神经网络Vi图
- 基于Labview的电子秤的设计.docx
- labview汽车仪表盘
- Scratch 贪吃蛇.sb3 小游戏源码
- labview掉halcon.vi
- labview计算器实例.vi88218
- labview 导DXF
- 基于LabVIEW模拟的温度报警器.vi
评论
共有 条评论