第一个战胜围棋世界冠军的人工智能程序是什么

第一个战胜围棋世界冠军的人工智能程序是什么,第1张

第一个战胜围棋世界冠军的人工智能程序是阿尔法狗。在韩国首尔举行的2016围棋人机大战中,阿尔法狗战胜了韩国名手李世石。

AlphaGo程序是美国谷歌公司旗下DeepMind团队开发的一款人机对弈的围棋程序,被中国棋迷们戏称为阿尔法狗。游戏是人工智能最初开发的主要阵地之一,比如博弈游戏就要求人工智能更聪明、更灵活,用更接近人类的思考方式解决问题。

扩展资料:

AlphaGo通过蒙特卡洛树搜索算法和两个深度神经网络合作来完成下棋。在与李世石对阵之前,谷歌首先用人类对弈的近3000万种走法来训练“阿尔法狗”的神经网络,让它学会预测人类专业棋手怎么落子。

然后更进一步,让AlphaGo自己跟自己下棋,从而又产生规模庞大的全新的棋谱。谷歌工程师曾宣称AlphaGo每天可以尝试百万量级的走法。

参考资料来源:人民网——“阿尔法狗”为什么厉害

form1:

Private Sub Com1_Click(Index As Integer)

Select Case Index

Case 0

Label3Caption = Combo1Text

Send "5" + Combo1Text

Case 1

Combo1Text = ""

Case 2

Send "3"

ResetGame

If Server = 1 Then Pic1Enabled = True Else Pic1Enabled = False

Case 3

If Label2Caption = "连线中" Then

Send "4"

DoEvents

End If

Winsock1Close

Label2Caption = "尚未连线"

Load Form2

Form2Show

Case 4

If Label2Caption = "连线中" Then

Send "4"

DoEvents

End If

Winsock1Close

End

End Select

End Sub

Private Sub Form_Load()

Open "net5txt" For Input As #1

Do

Input #1, Gdata

Combo1AddItem Gdata

If EOF(1) Then Close #1: Exit Sub

Loop

End Sub

Private Sub Form_Unload(Cancel As Integer)

If Label2Caption = "连线中" Then

Send "4"

DoEvents

End If

Winsock1Close

End

End Sub

Private Sub Pic1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = 1 Then

sx = Fix(X / 21) + 1: sy = Fix(Y / 20) + 1

If map(sx, sy) <> 0 Then Exit Sub

Call sndPlaySound("putwav", 0)

map(sx, sy) = Server

DrawScreen

a = GameOver(Server)

If a = Server Then

Image1(0)Visible = True

Win(Server) = Win(Server) + 1

If Server = 1 Then Lost(2) = Lost(2) + 1 Else Lost(1) = Lost(1) + 1

Form1Label1(2)Caption = "战绩:" + Str(Win(1)) + "胜" + Str(Lost(1)) + "败"

Form1Label1(4)Caption = "战绩:" + Str(Win(2)) + "胜" + Str(Lost(2)) + "败"

End If

Send "1" + Chr(sx) + Chr(sy)

Pic1Enabled = False

End If

End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)

If Winsock1State <> sckClosed Then Winsock1Close

Winsock1Accept requestID

Label2Caption = "连线中"

OpenCom

Pic1Enabled = True

End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)

GetMyData bytesTotal

End Sub

Private Sub Winsock1_Connect()

Label2Caption = "连线中"

Send "2" + Label1(3)Caption

OpenCom

End Sub

form2:

Private Sub Command1_Click()

If Server = 1 Then

Form1Winsock1LocalPort = 5238

Form1Winsock1Listen

Form1Label1(1)Caption = "黑子:" + Text1Text

Form1Label1(3)Caption = ""

Form1Label2Caption = "等待加入中"

Else

Form1Winsock1RemoteHost = Text2Text

Form1Winsock1RemotePort = 5238

Form1Winsock1LocalPort = 0

Form1Winsock1Connect

Form1Label1(1)Caption = ""

Form1Label1(3)Caption = "白子:" + Text1Text

Form1Label2Caption = "正在连线到主机"

End If

Form1Label1(2)Caption = "战绩:" + Str(Win(1)) + "胜" + Str(Lost(1)) + "败"

Form1Label1(4)Caption = "战绩:" + Str(Win(2)) + "胜" + Str(Lost(2)) + "败"

Form1Show

Form1Pic1Enabled = False

Form1Enabled = True

Form2Hide

Unload Form2

ResetGame

End Sub

Private Sub Command2_Click()

End

End Sub

Private Sub Form_Load()

Form1Enabled = False

CloseCom

Text2Text = Form1Winsock1LocalIP

Server = 1

Win(1) = 0

Win(2) = 0

Lost(1) = 0

Lost(2) = 0

End Sub

Private Sub Option1_Click()

Label3Caption = "你的主机IP"

Text2Text = Form1Winsock1LocalIP

Server = 1

End Sub

Private Sub Option2_Click()

Label3Caption = "连线主机IP"

Text2Text = "0000"

Server = 2

End Sub

模块:

Declare Sub BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long)

Declare Function sndPlaySound Lib "Winmmdll" Alias "sndPlaySoundA" (ByVal SoundName As String, ByVal Flags As Long) As Long

Global Const srccopy = &HCC0020

Global Const srcand = &H8800C6

Global Const srcor = &HEE0086

Public map(1 To 15, 1 To 15) '棋盘

Public Win(1 To 2), Lost(1 To 2) '储存胜败次数

Public Server '存放目前为主机或加入连线

'主机=1 加入连线=2

Sub Main()

Load Form1

Load Form2

Form1Show

Form2Show

End Sub

Sub DrawScreen() '画出棋子

X = 3: Y = 2

For i = 1 To 15

For j = 1 To 15

If map(i, j) = 1 Then BitBlt Form1Pic1hDC, X, Y, 21, 20, Form1Pic2hDC, 0, 0, srccopy

If map(i, j) = 2 Then BitBlt Form1Pic1hDC, X, Y, 21, 20, Form1Pic2hDC, 21, 0, srccopy

If map(i, j) = 3 Then BitBlt Form1Pic1hDC, X, Y, 21, 20, Form1Pic2hDC, 42, 0, srccopy

If map(i, j) = 4 Then BitBlt Form1Pic1hDC, X, Y, 21, 20, Form1Pic2hDC, 63, 0, srccopy

Y = Y + 20

Next j

Y = 2

X = X + 21

Next i

Form1Pic1Refresh

End Sub

Sub Send(mydata As String) '送出资料

Form1Winsock1SendData mydata

End Sub

Sub GetMyData(Size) '接受资料

Dim mydata As String

Form1Winsock1GetData mydata, vbString

Select Case Mid(mydata, 1, 1)

Case "1" '棋子的资料

If Server = 1 Then s = 2 Else s = 1

Call sndPlaySound("putwav", 0)

sx = Asc(Mid(mydata, 2, 1))

sy = Asc(Mid(mydata, 3, 1))

map(sx, sy) = s + 2

DrawScreen

map(sx, sy) = s

a = GameOver(s)

Form1Pic1Enabled = True

If a = s Then

Form1Image1(1)Visible = True

Form1Pic1Enabled = False

Lost(Server) = Lost(Server) + 1

Win(s) = Win(s) + 1

Form1Label1(2)Caption = "战绩:" + Str(Win(1)) + "胜" + Str(Lost(1)) + "败"

Form1Label1(4)Caption = "战绩:" + Str(Win(2)) + "胜" + Str(Lost(2)) + "败"

End If

Case "2" '名字资料

If Server = 1 Then

Form1Label1(3)Caption = Mid(mydata, 2, Size - 1)

Send "2" + Form1Label1(1)Caption

Else

Form1Label1(1)Caption = Mid(mydata, 2, Size - 1)

End If

Case "3" '开新棋局送的资料

ResetGame

Case "4" '对方断线送的资料

Form1Label2Caption = "尚未连线"

Form1Pic1Enabled = False

CloseCom

Form1Winsock1Close

Case "5" '聊天视窗的资料

Form1Label1(0)Caption = Mid(mydata, 2, Size - 1)

Case Else

End Select

End Sub

Function GameOver(a) '判断是否连成五颗

For i = 1 To 11

For j = 1 To 11

If map(i, j) = a And map(i + 1, j + 1) = a And map(i + 2, j + 2) = a And map(i + 3, j + 3) = a And map(i + 4, j + 4) = a Then GameOver = a: Exit Function

Next j

Next i

For i = 5 To 15

For j = 5 To 15

If map(i, j) = a And map(i - 1, j - 1) = a And map(i - 2, j - 2) = a And map(i - 3, j - 3) = a And map(i - 4, j - 4) = a Then GameOver = a: Exit Function

Next j

Next i

For i = 5 To 15

For j = 1 To 11

If map(i, j) = a And map(i - 1, j + 1) = a And map(i - 2, j + 2) = a And map(i - 3, j + 3) = a And map(i - 4, j + 4) = a Then GameOver = a: Exit Function

Next j

Next i

For i = 1 To 11

For j = 5 To 15

If map(i, j) = a And map(i + 1, j - 1) = a And map(i + 2, j - 2) = a And map(i + 3, j - 3) = a And map(i + 4, j - 4) = a Then GameOver = a: Exit Function

Next j

Next i

For i = 1 To 15

For j = 5 To 11

If map(i, j) = a And map(i, j - 1) = a And map(i, j - 2) = a And map(i, j - 3) = a And map(i, j - 4) = a Then GameOver = a: Exit Function

If map(i, j) = a And map(i, j + 1) = a And map(i, j + 2) = a And map(i, j + 3) = a And map(i, j + 4) = a Then GameOver = a: Exit Function

Next j

Next i

For i = 5 To 11

For j = 1 To 15

If map(i, j) = a And map(i + 1, j) = a And map(i + 2, j) = a And map(i + 3, j) = a And map(i + 4, j) = a Then GameOver = a: Exit Function

If map(i, j) = a And map(i - 1, j) = a And map(i - 2, j) = a And map(i - 3, j) = a And map(i - 4, j) = a Then GameOver = a: Exit Function

Next j

Next i

GameOver = 0

End Function

Sub ResetGame() '开新棋局

Form1Pic1Cls

For i = 1 To 15

For j = 1 To 15

map(i, j) = 0

Next j

Next i

Form1Image1(0)Visible = False

Form1Image1(1)Visible = False

End Sub

Sub CloseCom() '将能送出资料的控制项除能

Form1Com1(0)Enabled = False

Form1Com1(2)Enabled = False

End Sub

Sub OpenCom() '将能送出资料的控制项致能

Form1Com1(0)Enabled = True

Form1Com1(2)Enabled = True

End Sub

如果不懂要添加的控件,请留下邮箱,我将工程VBP文件发给你。

这里还有聊天功能。

希望能给点分!

最好的围棋软件就是国内的手谈2、日本的乌鹫

这两者的棋力都只有8级左右。按照现在的水平和硬件发展速度,3年长1级的水平

下载地址介绍:>

#include"stdioh"#include"conioh"intmain(void){ints;intf;intm;printf("请输入一个时间:\n");scanf("%i%i%i",&s,&f,&m);if(m==59){m=0;f=f++;printf("%i%i%i\n",s,f,m);}else{m=m++;printf("%i%i%i\n",s,f,m);}getch();}

以上就是关于第一个战胜围棋世界冠军的人工智能程序是什么全部的内容,包括:第一个战胜围棋世界冠军的人工智能程序是什么、谁能设计一段围棋程序、目前AI最高的围棋程序是什么等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/10218312.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-06
下一篇 2023-05-06

发表评论

登录后才能评论

评论列表(0条)

保存