原题链接--

https://acs.jxnu.edu.cn/problem/CF3Chttps://acs.jxnu.edu.cn/problem/CF3C

Tic-tac-toe

1000ms  65536K

描述:

Certainly, everyone is familiar with tic-tac-toe game. The rules are very simple indeed. Two players take turns marking the cells in a 3 × 3 grid (one player always draws crosses, the other — noughts). The player who succeeds first in placing three of his marks in a horizontal, vertical or diagonal line wins, and the game is finished. The player who draws crosses goes first. If the grid is filled, but neither Xs, nor 0s form the required line, a draw is announced.

You are given a 3 × 3 grid, each grid cell is empty, or occupied by a cross or a nought. You have to find the player (first or second), whose turn is next, or print one of the verdicts below:

  • illegal — if the given board layout can't appear during a valid game;
  • the first player won — if in the given board layout the first player has just won;
  • the second player won — if in the given board layout the second player has just won;
  • draw — if the given board layout has just let to a draw.

译文: 当然,每个人都很熟悉井字游戏。它的规则实际上非常简单。两个玩家轮流在3x3的网格中标记单元格(一个玩家画叉,一个玩家画圈)。第一个玩家的三个标记在一个水平、垂直或对角线上的获胜,游戏结束。画叉的玩家先走。如果网格被填满,但是x和0都没有连成线,就宣布平局。

你是被给了一个3X3的网格,每一个网格单元都是空的,用叉或圈来填满。你必须找到下一个轮到谁的玩家(第一个或第二个) ,或者打印下面的判决之一:

illegalー如果给定的棋盘布局在一个有效的游戏中不能出现;

the first player won — 如果给定的棋盘布局中第一个玩家获胜;

the second player won — 如果给定的棋盘布局中第二个玩家获胜;

draw — 如果给定的棋盘布局中达成平局;

输入:

The input consists of three lines, each of the lines contains characters ".", "X" or "0" (a period, a capital letter X, or a digit zero).

译文:输入有三行,每一行都包含字符".", "X" 或 "0"(一个句号,一个大写字母或是一个数字0)。

输出:

Print one of the six verdicts: first, second, illegal, the first player won, the second player won or draw.

译文:打印六个判决之一:first, second, illegal, the first player won, the second player won或 draw.

样例输入:

X0X
.0.
.X.

样例输出:

second

CF3C--Tic-tac-toe翻译相关推荐

  1. react中使用构建缓存_通过在React中构建Tic Tac Toe来学习ReasonML

    react中使用构建缓存 3. 7. 2018: UPDATED to ReasonReact v0.4.2 3. 7. 2018:更新为ReasonReact v0.4.2 You may have ...

  2. python井字棋ai,python 井字棋(Tic Tac Toe)

    说明 用python实现了井字棋,整个框架是本人自己构思的,自认为比较满意.另外,90%+的代码也是本人逐字逐句敲的. minimax算法还没完全理解,所以参考了这里的代码,并作了修改. 特点 可以选 ...

  3. python二维游戏示例_Python实现的井字棋(Tic Tac Toe)游戏示例

    本文实例讲述了Python实现的井字棋(Tic Tac Toe)游戏.分享给大家供大家参考,具体如下: 说明 用python实现了井字棋,整个框架是本人自己构思的,自认为比较满意.另外,90%+的代码 ...

  4. python游戏代码运行不了_无法使我的tic tac toe游戏在python中正确运行

    转不到"玩家1"的原因是你的支票中缺少一个空格.你也没有正确地检查一个玩家何时获胜,这就是为什么你会有这种奇怪的行为.你需要检查每个位置,而不仅仅是最后一个.我还添加了对用户输入的 ...

  5. Principle of Computing (Python)学习笔记(7) DFS Search + Tic Tac Toe use MiniMax Stratedy

    1. Trees Tree is a recursive structure. 1.1 math nodes https://class.coursera.org/principlescomputin ...

  6. amazon.设计1. tic tac toe

    //不觉中 已经全力找工作好久好久了.大概有1年半了.身心疲惫,不要放弃.曙光快来了. 1.tic tac toe //http://www.ntu.edu.sg/home/ehchua/progra ...

  7. python井字棋游戏代码_Python实现的井字棋(Tic Tac Toe)游戏示例

    Python实现的井字棋(Tic Tac Toe)游戏示例 来源:中文源码网    浏览: 次    日期:2018年9月2日 [下载文档:  Python实现的井字棋(Tic Tac Toe)游戏示 ...

  8. C++ 很有趣:编写一个井字游戏 (Tic Tac Toe)

    英文原文:C++ is fun: Writing a Tic Tac Toe Game 这个有趣的C++系列打算展示一下使用C++写代码可以和其他主流语言一样高效而有趣.在第二部分,我将向你展示使用C ...

  9. 圈叉游戏 java_【炫光圈叉棋】炫光圈叉棋 Tic Tac Toe Glow 1.8.1下载_安卓(android)软件下载-魅族溜...

    一款炫光风格的圈叉棋游戏,支持单/双人模式.圈叉棋,英文:tic-tac-toe,别名:圈叉游戏.是一种游戏,3*3的9个方格子,先下者画圈,后下者画叉,每人可以在任意没有对方棋子的封闭方格里下一次, ...

  10. java tic tac toe_请问我这个tic tac toe的游戏代码的问题在哪里

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 Scanner in = new Scanner(System.in); final int SIZE =3; int[][] board = new i ...

最新文章

  1. 转 graphviz工具及其原理
  2. java udp传输文件_JAVA使用UDP收发文件
  3. COM组件与.NET技术对比
  4. 计算理论入门 1.1 命题逻辑
  5. python 中字符串大小写转换
  6. Software Switching优化
  7. 我的权限系统设计实现MVC4 + WebAPI + EasyUI + Knockout(二)菜单导航
  8. [转]小D课堂 - 零基础入门SpringBoot2.X到实战_汇总
  9. 【收藏级教程】专业Finereport教程,帆软报表教程
  10. GUI开发和JDBC编程实现员工管理
  11. cuda历史版本下载
  12. macOS和Linux系统中的虚拟网卡(xFsRedir虚拟局域网功能扩展之其他平台的实现)
  13. 解决鼠标单击变双击问题
  14. 先进驾驶员辅助系统ADSA
  15. 全国移动短信信息中心号码查询大全
  16. uiautomatorviewer Error obtaining UI hierarchy
  17. WIN11安装子系统
  18. BZOJ 1778 Usaco2010 驱逐猪猡
  19. 计算机网络无线局域网设计,《计算机网络》网络课程“无线局域网”单元的设计与开发...
  20. 自动驾驶感知——毫米波雷达

热门文章

  1. Java---中文词匹配 正向、逆向和双向最大匹配算法
  2. Java实现 LeetCode 389 找不同
  3. ES elasticsearch 7.10安装部署
  4. 要不要我教你如何提取出视频的伴奏
  5. Flutter调用平台代码
  6. 概念系列1:标准差标准误
  7. 谷歌Android法律风险不容忽视
  8. 车压线被拍,交管12123上显示被查封?租赁京牌的短板出现。
  9. Gstreamer API
  10. 将零碎内容价值化,“清博大数据”为政府、企业提供新媒体大数据服务