【C++ 程序】 井字棋游戏(人 VS 人)(EasyX 图形界面)

分析见我的博客 【C++ 程序】 井字棋游戏(人 VS Lv3电脑)(战绩统计版)(EasyX 图形界面)
提一句,不知为什么我的电脑将其认定为病毒。自己编的中是第4次遇到这种情况了。
注意要下载 Easy-X,其中包含库graphics.h

程序

//This program is a simple tic-tac-toe game.

#include <iostream>
#include <string>
#include <cstddef>
#include <stdexcept>
#include <Windows.h>
#include <graphics.h>
#include <conio.h>
using namespace std;

IMAGE imageX, image0, imageXt, image0t, imageXw, image0w, imageD;

char point_now[3][3] = {
    ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };
char player = 'X';
unsigned step_count = 0;

int win_lose(char point[3][3], int n)
{
   
	if (point[0][0] == point[0][1] && point[0][1] == point[0][2] && point[0][0] == 'X') return 1; // X wins
	if (point[1][0] == point[1][1] && point[1][1] == point[1][2] && point[1][0] == 'X') return 1; // X wins
	if (point[2][0] == point[2][1] && point[2][1] == point[2][2] && point[2][0] == 'X') return 1; // X wins
	if (point[0][0] == point[1][0] && point[1][0] == point[2][0] && point[0][0] == 'X') return 1; // X wins
	if (point[0][1] == point[1][1] && point[1][1] == point[2][1] && point[0][1] == 'X') return 1; // X wins
	if (point[0][2] == point[1][2] && point[1][2] == point[2][2] && point[0][2] == 'X') return 1; // X wins
	if (point[
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值