Tic Tac Toe的2和3维的简单Visual Basic版本(译文)
By robot-v1.0
本文链接 https://www.kyfws.com/games/a-simple-visual-basic-version-of-tic-tac-toe-in-2-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 2 分钟阅读 - 781 个词 阅读量 0Tic Tac Toe的2和3维的简单Visual Basic版本(译文)
原文地址:https://www.codeproject.com/Articles/6770/A-simple-Visual-Basic-Version-of-Tic-Tac-Toe-in-2
原文作者:Jeff Arrington
译文由本站 robot-v1.0 翻译
前言
A Tic Tac Toe game in 2D and 3D. The kids will enjoy.
2D和3D井字游戏.孩子们会喜欢的.
介绍(Introduction)
这只是一个简单的井字游戏.我为所有不了解规则的人提供了一个规则Word文档,但是让我继续为您节省时间:(This is just a simple Tic Tac Toe game. I’ve included a Rules Word Doc for anyone who doesn’t know the rules, but let me just go ahead and save you the time:)
- 如果您是X,则连续获得三个X(If you are X’s then get three X’s in a row)
- 如果您是O,则连续获得三个O(If you are O’s then get three O’s in a row) 请注意,如果使用3D,它将显示所有可能的获胜组合.参见上图.(Note that, with 3D, it will show all possible winning combinations if applicable. See picture above.) 相当令人困惑的东西,呵呵.(Pretty confusing stuff huh….ha ha.) 这至少是程序的二维部分,是一个类分配.我花了一点时间,也做了3D.确实没有那么困难,只是更多的额外检查.基本上,您只需将每步移动添加到数组中,然后在每回合后检查是否有合适的获胜组合.我已经在源代码中添加了注释,因此相对容易遵循.希望你喜欢这个游戏.(This was a class assignment, well at least, just the 2 dimensional part of the program. I went a little over board and did 3D also. It really wasn’t that difficult, it was just a lot more extra checking. Basically, you just add each move into an array and check for appropriate winning combinations after every turn. I’ve added comments in the source code, so it is relatively easy to follow. Hope you enjoy the game.) 这是一个有趣的孩子们的游戏.您可以非常简单地更改代码,以便两个人进行个性化设置,以便显示优胜者的姓名.孩子们喜欢在PC上看到他们的名字.(It’s a fun kid’s game. You can change the code very simply to personalize it for two people so that it will show the name of the winner. Kids like to see their name on the PC.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
VB Win2K WinXP Win2003 Windows .NET1.1 Visual-Studio VS.NET2003 Dev 新闻 翻译