- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在 C++ 中使用 #include "graphics.h"
。
我使用 visual studio 2008 作为我的 IDE。
问题是我无法构建我的代码。
这是我的代码...
#include<stdio.h>
#include<conio.h>
#include "graphics.h"
#include<stdlib.h>
#include<dos.h>
char game[3][3];
void screen(void);
void introducing(void);
void input(void);
void circle(int,int);
void cross(int,int);
void main(void)
{
int gd=DETECT, gm, errorcode; /* request auto detection */
char msg[80];
initgraph(&gd,&gm,"\\tc\\bgi"); /* initialize graphics */
errorcode = graphresult(); /* read result of initialization */
if(errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
cleardevice();
introducing();
getche();
cleardevice();
screen();
getche();
closegraph();
}
void introducing(void) /*introduction of the project*/
{
setbkcolor(5);
int loop;
setcolor(1);
int r,c;
settextstyle(5,0,3);
outtextxy(250,200,"Loading...");
rectangle(90,140,510,180);
for(r=0;r<100;r++)
{
for(c=0;c<100;c++)
{
bar(100+c,150,400+c,170); /*loading bar*/
delay(100);
}
break;
}
cleardevice();
settextstyle(7,0,4);
outtextxy(20,150,"We present you the game tic tac toe!");
delay(2100);
for (loop=0; loop<500; loop++)
{
setcolor(11);
settextstyle(3,0,1);
outtextxy(640-(loop+130),10,"IN THE NAME OF ALLAH, THE MOST GRACIOUS AND THE MOST MERCIFUL!"); /*text moving from right to left*/
settextstyle(7,0,3);
outtextxy(30,300+(loop-300),"Made by:Urooj Sohail & Taleaa Ghori"); /*text moving from top to bottom*/
cleardevice();
}
settextstyle(3,0,1);
outtextxy(640-(500+130),10,"IN THE NAME OF ALLAH, THE MOST GRACIOUS AND THE MOST MERCIFUL!");
settextstyle(7,0,3);
outtextxy(30,400,"Made by:Urooj Sohail & Taleaa Ghori");
se ttextstyle(7,0,4);
setcolor(4);
outtextxy(10,100,"Welcome! YOU(X) v/s COMPUTER(0)");
outtextxy(200,150,"Press Enter");
}
void screen(void) /*game board*/
{
setbkcolor(9);
{
settextstyle(5,0,8);
outtextxy(70,300,"Tic Tac Toe");
} setfillstyle(13,4);
bar(200,120,410,330); /*setting the background of the board*/
int row,col;
for(row=0;row<=200;row=row+70)
{
for(col=0;col<=200;col=col+70)
{
setcolor(0);
rectangle(200+col,120+row,270+col,190+row); /*drawing the board of 9 boxes*/
}
}
input(); /*taking input through function*/
}
void input()
{
int x,y;
printf("Enter X co-ordinate -- ");
scanf("%d",&x);
printf("Enter Y co-ordinate -- ");
scanf("%d",&y);
}
/*
for(int x=0;x<=2;x++)
{
for(int y=0;y<=2;y++)
{
if(game[x][y]=='X')
cross(x,y);
if(game[x][y]=='O')
circle(x,y);
}
}
if(game[x-1][y-1]=='*')
game[x-1][y-1]='X';
/*if(game[x-1][y-1]==game[0][0]) /*drawing circle
circle(235,155,20);
if(game[x-1][y-1]==game[0][1])
circle(305,155,20);
if(game[x-1][y-1]==game[0][2]) /*till 1st row
circle(375,155,20);
if(game[x-1][y-1]==game[1][0])
circle(235,225,20);
if(game[x-1][y-1]==game[1][1])
circle(305,225,20);
if(game[x-1][y-1]==game[1][2])
circle(375,225,20); /*till 2nd row
if(game[x-1][y-1]==game[2][0])
circle(235,295,20);
if(game[x-1][y-1]==game[2][1])
circle(305,295,20);
if(game[x-1][y-1]==game[2][2]) /*till 3rd row
circle(375,295,20);
if(game[x-1][y-1]==game[0][0]) /*drawing cross
line(215,135,255,175);
line(255,135,215,175);
if(game[x-1][y-1]==game[0][1])
line(285,135,325,175);
line(325,135,285,175);
if(game[x-1][y-1]==game[0][2])
line(355,135,395,175); /*till 1st row*
line(395,135,355,175);
if(game[x-1][y-1]==game[1][0])
line(215,205,255,245);
line(255,205,215,245);
if(game[x-1][y-1]==game[1][1])
line(285,205,325,245);
line(325,205,285,245);
if(game[x-1][y-1]==game[1][2])
line(355,205,395,245); /*till 2nd row*
line(395,205,355,245);
if(game[x-1][y-1]==game[2][0])
line(215,275,255,315);
line(255,275,215,315);
if(game[x-1][y-1]==game[2][1])
line(285,275,325,315);
line(325,275,285,315);
if(game[x-1][y-1]==game[2][2]) *till 3rd row*
line(355,275,395,315);
line(395,275,355,315);
}
*/
最佳答案
那些函数和头文件是旧 Borland 图形扩展的一部分,而不是标准 C 库或 Visual Studio 的一部分。
关于c++ - 无法打开包含文件 : 'graphics.h' : No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5970302/
当我尝试构建我的项目时,我遇到了这样的错误: FAILURE: Build failed with an exception. * What went wrong: Execution failed
我正在尝试从 Here 构建适用于 linux 3.7 内核的 Mali 驱动程序. 有一个单独的构建脚本,例如, #!/bin/bash export KDIR=/path/to/kernel/di
有没有一种方法可以使用普通的 lisp 创建目录。我想先创建一个文件夹,然后将我的 .txt .png 文件放入其中。我知道首先我可以在外部创建文件夹,然后使用 with-open-file 等在目录
Visual Studio 提示每次编译警告 MSB8029:中间目录或输出目录不能位于临时目录下,因为它可能导致增量构建出现问题。 我正在检查项目并更改了输出目录和中间目录,但我仍然在我的解决方案中
Visual Studio 提示每次编译警告 MSB8029:中间目录或输出目录不能位于临时目录下,因为它可能导致增量构建出现问题。 我正在检查项目并更改了输出目录和中间目录,但我仍然在我的解决方案中
我的客户安装了 Keycloak 以从 AWS Cognito 代理用户。 我需要这个 Keycloak 来代理来自 Azure Active Directory 的用户。 客户拥有 AAD 的 OF
我想从 macOS 上 parallel 命令的所有潜力中受益(似乎存在 2 个版本,GNU 和 Ole Tange 的版本,但我不确定)。 使用以下命令: parallel -j8 find {}
我需要实现一个 Active Directory(本地)管理器,用户可以在其中执行所有任务,例如添加用户、删除用户、分配许可证和分配组等。用户有用户名、密码和域 Controller 名称,所以他只需
我正在编写一个使用PHP adLDAP库与Active Directory交互的应用程序。 为了测试该应用程序,我需要使用Active Directory架构的本地LDAP DB以及示例数据。 我已经
我有一个包含两个域 AA.RR.COM 和 BB.RR.COM 的 Active Directory 林,其中包含用户和组。我需要搜索两个域中的用户,同时查询其中一个域(例如 AA.RT.COM)如何
我使用 Proxy-Address 属性作为确定用户电子邮件地址的主要方法(我只关心以“SMTP:”或“smtp:”为前缀的地址,此外,我使用以大写字母为前缀的地址SMTP 来确定主地址 - 这不是
这个问题不太可能对任何 future 的访客有帮助;它只与一个较小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于全世界的互联网受众。如需帮助使此问题更广泛适用,visit the
所以我有一个目录 - 让我们说/dir/。在里面我有这些文件夹-/目录/fold1//目录/fold2//dir/fold3/ 这些文件夹 (fold1,2,3) 中的每一个都可能包含一个名为 foo
我正在使用 PHPmotion 在我本地的 ubuntu 机器上。 优步上传者在 phpmotion 中用于将文件上传到服务器。这是使用 perl 脚本(位于“ www/cgi-bin ”)上传文件。
我正在为我的公司开发一个基于 Web 的 Intranet。我只想知道用户使用事件目录登录详细信息登录应用程序是一件好事,还是我应该与应用程序数据库一起创建登录名。如果有什么比这更好的,请提出建议。这
我们有带有 AD 模块 1.0.4 的 Sitecore 6.5。 DEPARTMENT\SitecoreUsers AD 组中的用户可以登录 Sitecore,但 DEPARTMENT\Siteco
我使用的 AD 设置具有存储为(多个)安全组成员的用户。 我正在使用读取用户的 memberof 属性的软件来计算访问权限。 在 AD Explorer 中,我可以看到用户的 memberof 属性显
我们有一个在 .NET 上编写的 SaaS 应用程序,我们需要为我们的客户提供各种 SSO 方法。 不久前,我们对 OpenID 进行了标准化,希望这会成为一个通用标准,让我们不必支持不同的标准。不幸
我有 .Net 代码可以读取/写入我们本地的 Active Directory 域。阅读部分已经过测试并且工作正常,但我想测试“写作”部分。我的应用程序将修改事件目录中的一些用户配置文件,但我不想在实
我正在运行一个 ASP.NET 4.0 应用程序,它使用用户名(即 HttpContext.Current.Request.LogonUserIdentity.Name.ToString())来管理对
我是一名优秀的程序员,十分优秀!