Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
它背后的Reversi VB.net逻辑_Vb.net - Fatal编程技术网

它背后的Reversi VB.net逻辑

它背后的Reversi VB.net逻辑,vb.net,Vb.net,我正在尝试在VB.Net中制作reversi游戏。我在将游戏的逻辑翻译成vb.net时遇到了一些困难 如果按钮为黑色且旁边的按钮为白色,则白色按钮旁边的按钮将被按下 newButton.tag = colum of button + (row of button * amount of columns) -> I made 64 buttons via a function loop and added a tag Dim knop As Button = s

我正在尝试在VB.Net中制作reversi游戏。我在将游戏的逻辑翻译成vb.net时遇到了一些困难

如果按钮为黑色且旁边的按钮为白色,则白色按钮旁边的按钮将被按下

    newButton.tag = colum of button + (row of button * amount of columns)
    -> I made 64 buttons via a function loop and added a tag 


    Dim knop As Button = sender
    Dim value As String = knop.Tag
    If value = "...(?)" Then
        knop.BackColor = Color.Black
       If ....(?)
       End If
    End If
我已经用按钮的标签做了一个方案,但是我发现很难实现逻辑。有人能帮我弄一个吗


编辑:

如果您使用
Dim ButtonList As List(按钮列表(按钮列表))
并在运行时将按钮添加到表单中,您可以将每行的每个按钮添加到列表中,然后将该列表添加到按钮列表中。现在,您可以通过二维列表中的索引访问每个按钮


因为您要更改背景色,所以只需使用它,而不必使用标签。

不是每个人都知道反转的规则<代码>旁边的按钮根本不清楚,因为中间的按钮周围有4个按钮,如果包括对角线,则为8个。一旦你在自己的头脑中清楚地定义了这个问题,逻辑就会变得清晰