Tag: tic tac toe

在excel VBA上简单的Tic Tac Toe

我试图做一个非常简单的井字游戏,我有一个class,而不是X和O你的颜色单元格内部蓝色(用户)和红色(macros),没有人工智能。 但是每当我想到它就会陷入无限循环 Sub Tic() Dim r1 As Integer Dim r2 As Integer Do r1 = Int(Rnd * 3) + 1 r2 = Int(Rnd * 3) + 1 If Cells(r1, r2).Interior.Color = xlNone Then 'with colorindex instead of color it fills before crashing Cells(r1, r2).Interior.Color = vbRed End If Loop While Cells(r1, r2).Interior.Color = vbBlue Or […]