如何水平和垂直检查获胜者(C ++) [英] How do I make check for the winner horizontally and vertically (C++)
本文介绍了如何水平和垂直检查获胜者(C ++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨..
我正在制作一款名为connect four的游戏,我写了代码,但我不知道如何完成它,我应该做检查胜利者纵向或横向,任何人都可以帮我写代码....
Hi..
I'm making a game called connect four, I wrote the code but I don't know how to complete it, I should do check for the winner vertical or horizontal, can anyone help me to write the code please....
推荐答案
引用:
如何检查获胜者(C ++)
How do I make check for the winner (C++)
没有神奇的方法来检查获胜者。你必须检查所有的可能性。
充分利用你的知识:如果获胜者,最后一个标记是其中的一部分。
想想如何手动检查。机械思考。
There is not magic way to check for winner. You have to check all the possibilities.
Take advantage of your knowledge: if winner, the last token is part of it.
Think of how you would do to manually check. Think mechanically.
这篇关于如何水平和垂直检查获胜者(C ++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文