如何获得一个while循环继续tic tac toe游戏直到它结束。 [英] How to get a while loop to continue the tic tac toe game until it ends.

查看:77
本文介绍了如何获得一个while循环继续tic tac toe游戏直到它结束。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图让这个Tic Tac Toe游戏继续前进。每个玩家只需要1回合。还想弄清楚如何编制其中一个玩家获胜并确认游戏结束以及玩家是否想再玩一次的确认。



我尝试了什么:



尝试循环,但它只显示X,没有Os,也没有明确的结尾。

I'm trying to get this Tic Tac Toe game to continue going. It only goes 1 turn for each player. Also trying to figure out how to program the confirmation that one of the players won and recognize the end the game and if the players want to play again.

What I have tried:

Tried For loop, but it only shows X, no Os, and no definite ending.

推荐答案

建议:暂时停止尝试个人项目。

相反,找到教程并按照它们,他们会教你很多。



建议:不要学习使用C / C ++语言编程。这些语言比较困难,因为它们不会检查任何内容,你是一个需要关心的东西。

使用任何其他语言,你可以集中精力学习编程,然后当你坚持编程,转到C / C ++,如果你愿意的话。

选择一个Visual Basic,C#或Java,它们很受欢迎。



对于你的项目,学习数组,它们将简化你的生活。
Advice: Stop trying to do personal projects for now.
Instead, find tutorials and follow them, they will teach you a lot.

Advice: Do not learn programming with C/C++ languages. these languages are more difficult because they don't check anything, YOU are the one that have to care about anything.
With any other language, you can concentrate on learning programming, then when you are tough on programming, go to C/C++, if you want.
Pick one of Visual Basic, C# or Java, they are very popular.

For your project, learn arrays, they will simplify your life.


这是一个的例子,而在C:中的循环: a href =https://www.tutorialspoint.com/cprogramming/c_while_loop.htm>在C中循环 [ ^ ]

另请参阅此答案: Tic Tac Toe Tied Games [ ^ ]
Here is an example of a While loop in C: while loop in C[^]
Also see this answer: Tic Tac Toe Tied Games[^]


这篇关于如何获得一个while循环继续tic tac toe游戏直到它结束。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆