教程中国
PHOTOSHOP CS9.0中文版 MAYA 8.5 FOR WINDOWS Corel Painter v9.0 Flash MX2004 中文版 Illustrator cs2 中文版
VC++6.0含sp6 中英文版 VB6.0 +sp6 简体中文版 Borland Delphi 7汉化版 MSDN for vb6.0中文版 Visual Studio 2005简体
教程中国下属 文件存储共享专家BIBIDU.COM 提供大型软件,教材,源码,电影,音乐,图书等下载 更多精品请点此进入
  您目前所在位置: 教程中国 >> C >> 编程实例 >> 设计彩色框的C源程序 RSS订阅
设计彩色框的C源程序
教程(视频,书籍)下载:  ASP.NET AutoCAD 数据库 C# ASP java photoshop 网页设计 delphi 3dmax Flash C++ VB 张孝祥 实例   更多请进入BIBIDU搜索
IT搜索引擎   
/*
*
* Short driver module
*
*/

main()
{
clrscr();
box(1,1,23,79);
box(2,2,21,77);
box(3,3,19,75);
box(4,4,17,73);
box(5,5,15,71);
box(6,6,13,69);
box(7,7,11,67);
box(8,8,9,65);
box(9,9,7,63);
box(10,10,5,61);
box(11,11,3,59);
box(12,12,1,57);
poscur(24,1);
}

/************************************************************
* BOX *
*----------------------------------------------------------*
* Written by: Jeff Ebert 7/01/87 *
* Modified by: xxxxxxxxxx *
* *
* Please modify me! *
* Possible Enhancements include but are not limited t *
* 1) Variable box character styles [1 line or 2] *
* 2) Error checking *
* 3) Color options *
* *
* *
* This function builds a simple double frame for a menu. *
* The function is passed the parameters for the upper *
* left corner row, upper left corner column the height *
* of the frame and the width. *
* *
************************************************************/
#include

#define ULCOR 201
#define URCOR 187
#define LLCOR 200
#define LRCOR 188
#define /data/vb/VBAR 186
#define HBAR 205
#define ESC 27


box(row, col, hgt, wdth)
int row, col, hgt, wdth;

{
int x, y;

poscur(row,col);
putchar(ULCOR);
for(x = col 1; x <=(col wdth -1); x )
putchar(HBAR);
putchar(URCOR);

for(x = row 1; x <=(row hgt - 1); x ){
poscur(x,col);
putchar(/data/vb/VBAR);
poscur(x,col wdth);
putchar(/data/vb/VBAR);
}
poscur(x,col);
putchar(LLCOR);
for(x= col 1; x <=(col wdth -1); x )
putchar(HBAR);
putchar(LRCOR);
}

/********************************************************
* POSCUR *
*------------------------------------------------------*
* This function positions the cursor at the specified *
* x,y coordinate. It uses the ANSI standard ESCAPE *
* sequence to produce the desired effect. Its not the *
* fastest way to position the cursor, but perhaps the *
* most por. *
* *
********************************************************/
poscur(xcor,ycor)
int xcor,ycor;
{
printf("%c[%d;%dH",ESC,xcor,ycor);
}


/********************************************************
* CLRSCR *
*------------------------------------------------------*
* This function positions the cursor at the specified *
* x,y coordinate. It uses the ANSI standard ESCAPE *
* sequence to produce the desired effect. Its not the *
* fastest way to position the cursor, but perhaps the *
* most por. *
* *
********************************************************/
clrscr()
{
printf("%c[2J",ESC);
}

来源:十度教育
作者:
关键字:设计彩色框,C源程序
发表日期:2006-6-11 2:03:43

网页显示有限 阅读全文请下载本文完整版WORD文档

上一篇:排序算法演示:冒泡法   下一篇:以前常用的攻击软件源代码


2008-11-23 21:11:21
本文的相类似文章
  • 全屏幕模拟时钟的C源程序
  • 设计彩色框的C源程序
  • 在学习中进步 在进步中成长 教程中国相随您的成长之路
    华腾联合科技股份有限公司版权所有
    广告联系:Rosibo@163.com