»áÔ±£º ÃÜÂ룺 ¡¡Ãâ·Ñ×¢²á | Íü¼ÇÃÜÂë | »áÔ±µÇ¼ ÍøÒ³¹¦ÄÜ£º ¼ÓÈëÊÕ²Ø ÉèΪÊ×Ò³ ÍøÕ¾ËÑË÷  
¼¼ÊõÎĵµ > VBÎĵµ > VB.Net
ÓÃVB.NETʵÏÖÎå×ÓÆåµÄÈ˹¤ÖÇÄÜ
·¢±íÈÕÆÚ£º2003-12-01 00:00:00×÷ÕߣºÕ ³ö´¦£º  

                   ÒýÑÔ

       È˹¤ÖÇÄÜÒ²¾ÍÊÇËùνµÄAI(Artificial Intelligence)£¬ËüÊÇÒ»ÃźܳéÏóµÄ¼¼Êõ£¬AI³ÌÐòµÄ±àд²»ÐèÒªÒÀ¾ÝÈκμȶ¨µÄ˼¿¼Ä£Ê½»òÕß¹æÔò¡£ÓÈÆäÊÇÓÎÏ·ÖеÄAI¿ÉÒÔÍêÈ«ÒÀ³ÌÐòÉè¼ÆÕß±¾ÉíµÄ˼¿¼Âß¼­ÖÆ×÷¡£ÎÒ¸öÈËÈÏΪÈ˹¤ÖÇÄܵĺËÐÄÓ¦¸ÃÊÇʹ¼ÆËã»ú¾ßÓÐ×Ô¶¯µÄ´¦ÀíʼþµÄÄÜÁ¦£¬¶øÎÒÃǵÄËùÓеÄÑо¿Ò²Ó¦¸ÃΧÈÆ×ÅÕâÒ»·½Ïò¡£ÎÒÃǽñÌìÌÖÂÛµÄÊDzßÂÔÀàµÄÈ˹¤ÖÇÄÜ¡£

       ²ßÂÔÀàÈ˹¤ÖÇÄÜ¿ÉÒÔ˵ÊÇAIÖбȽϸ´ÔÓµÄÒ»ÖÖ£¬×î³£¼ûµÄ²ßÂÔÀàAIÓÎÏ·¾ÍÊÇÆåÅÌʽÓÎÏ·¡£ÔÚÕâÀàÓÎÏ·ÖУ¬Í¨³£µÄ²ßÂÔÀàAI³ÌÐò¶¼ÊÇʹ¼ÆËã»úÅжÏÄ¿Ç°×´¿öÏÂËùÓпÉ×ßµÄÆåÓë¿ÉÄܵĻñʤ״¿ö£¬²¢¼ÆË㵱ǰ¼ÆËã»ú¿É×ßÆå²½µÄ»ñʤ·ÖÊý»òÕßÍæ¼Ò¿É×ßÆå²½µÄ»ñʤ·ÖÊý£¬È»ºóÔÙ¾ö¶¨³öÒ»¸ö×î¼Ñ×ß·¨¡£ÏÂÃæÎÒÃÇÏȽéÉÜÒ»ÏÂÎå×ÓÆåµÄAI¹¹Ïë¡£

             µÚÒ»²¿·Ö    Îå×ÓÆåµÄAI¹¹Ïë

       Óо仰½Ð¡°µ±¾ÖÕßÃÔ£¬ÅÔ¹ÛÕßÇå¡£¡±£¬µ«Õâ¾ä»°ÔÚÓÉAIËù¿ØÖƵļÆËã»úÍæ¼ÒÉÏÊDz»³ÉÁ¢µÄ£¬ÒòΪ¼ÆËã»ú±ØÐëÖªµÀÓÐÄÇЩ»ñʤ·½Ê½£¬²¢¼ÆËã³öÿÏÂÒ»²½Æåµ½ÆåÅÌÉÏÈÎÒ»¸ñ×ӵĻñʤ¼¸ÂÊ£¬Ò²¾ÍÊÇ˵£¬Ò»¸öÍêÕûµÄÎå×ÓÆåµÄAI¹¹Ïë±ØÐ룺1,Äܹ»ÖªµÀËùÓеĻñʤ×éºÏ£¬2,½¨Á¢ºÍʹÓûñʤ±í£¬3£¬É趨»ñʤµÄ·ÖÊý£¬4£¬Ê¹µçÄÔ¾ßÓй¥»÷ºÍ·ÀÊصÄÄÜÁ¦¡£

Ò»£¬ÇóÎå×ÓÆåµÄ»ñʤ×éºÏ

ÔÚÒ»³¡Îå×ÓÆåµÄÓÎÏ·ÖУ¬¼ÆËã»ú±ØÐëÒªÖªµÀÓÐÄÇЩµÄ»ñʤ×éºÏ£¬Òò´ËÎÒÃDZØÐëÇóµÃ

»ñʤ×éºÏµÄ×ÜÊý¡£ÎÒÃǼٶ¨µ±Ç°µÄÆåÅÌΪ10*10¡£

       £¨1£©£¬¼ÆËãˮƽ·½ÏòµÄ»ñʤ×éºÏÊý£¬Ã¿Ò»ÁеĻñʤ×éºÏÊÇ£º6£¬¹²10ÁУ¬ËùÒÔˮƽ·½ÏòµÄ»ñʤ×éºÏÊýΪ£º6*10=60

       £¨2£©£¬¼ÆËã´¹Ö±·½ÏòµÄ»ñʤ×éºÏ×ÜÊý£¬Ã¿Ò»ÐеĻñʤ×éºÏÊÇ£º6£¬¹²10ÐУ¬Ôò´¹Ö±·½ÏòµÄ»ñʤ×éºÏÊýΪ£º6*10=60

       £¨3£©£¬¼ÆËãÕý¶Ô½ÇÏß·½ÏòµÄ»ñʤ×éºÏ×ÜÊý£¬Õý¶Ô½ÇÏßÉϵĻñʤ×éºÏ×ÜÊýΪ6+£¨5+4+3+2+1£©*2=36

       £¨4£©£¬¼ÆËã·´¶Ô½ÇÏß·½ÏòµÄ»ñʤ×éºÏ×ÜÊý£¬·´¶Ô½ÇÏßÉϵĻñʤ×éºÏ×ÜÊýΪ6+£¨5+4+3+2+1£©*2=36

       ÕâÑùËùÓеĻñʤ×éºÏÊýΪ£º60+60+36+36=192

¶þ£¬½¨Á¢ºÍʹÓûñʤ±í

       ÎÒÃÇÒѾ­¼ÆËã³öÁËÒ»¸ö10*10µÄÎå×ÓÆåÅÌ»áÓÐ192ÖÖ»ñʤ·½Ê½£¬ÕâÑùÎÒÃÇ¿ÉÒÔÀûÓÃÊý×齨Á¢»ñʤ±í£¬»ñʤ±íµÄÖ÷Òª×÷ÓÃÊÇ£º1£¬Åжϵ±Ç°µÄ»ñʤ·½Ê½ÊÇ·ñÓÐЧ£»2£¬Åжϵ±Ç°µÄ»ñʤ·½Ê½Öе½µ×ÓжàÉÙ×ÓÂäÈë¸Ã»ñʤ×éºÏÖС£ÏêϸµÄʹÓÃÄú½«ÔÚºóÃæµÄ³ÌÐòÖпÉÒÔ¿´³ö¡£

Èý£¬·ÖÊýµÄÉ趨

ÔÚÓÎÏ·ÖÐΪÁËÈüÆËã»úÄܹ»¾ö¶¨ÏÂÒ»²½×î¼ÑµÄ×ß·¨£¬±ØÐëÏȼÆËã³ö¼ÆËã»úϵ½ÆåÅÌ

ÉÏÈÎÒ»¿Õ¸ñµÄ·ÖÊý£¬¶øÆäÖÐ×î¸ß·ÖÊý±ãÊǼÆËã»úÏÂÒ»²½µÄ×î¼Ñ×ß·¨¡£

Ô­Àí£ºÎÒÃÇÅж¨µ±Ç°ÌÖÂ۵ĿոñÓ뵱ǰÌÖÂ۵ĵãÓм¸ÖÖ»ñʤµÄ·½Ê½£¬Óм¸Öָÿոñ¾Í¼Ó¼¸·Ö¡£ÕâÖÖÔ­Àí³õÌýÆðÀ´ËƺõÊÇÎÞ·¨ÈëÊÖ£¬Ã»¹Øϵ£¬µ±ÄúÁ˽âÎÒÃǺóÃæµÄ³ÌÐòºóÄú¾Í»áÃ÷°×ÕâÖÖ¾ö²ßÔ­ÀíÁË¡£

ÕâÖÖ¾ö²ßÓÐһЩȱÏÝ£¬ÒòΪÈç¹ûÖ»¸ù¾ÝÕâ¸öÄ£ÐÍÉè¼Æ£¬¾ÍÓпÉÄܳöÏÖµçÄÔ»òÍæ¼ÒÓÐÈý¸ö×ÓÁ¬³ÉÒ»ÏßµÄʱºò£¬¼ÆËã»úÈ´Åжϲ»³ö£¬ËüÈÏΪÆäËûijЩ¿Õ¸ñÊǵ±Ç°µÄ»ñʤµÄ×î¼ÑλÖöø²»È¥¹¥»÷»ò·ÀÊØ¡£Ã»¹ØϵÎÒÃÇÍêÈ«¿ÉÒÔͨ¹ýÒ»¸ö¼ÓÇ¿Ëã·¨À´¸Ä±äµ±Ç°µÄ·ÖÖµÇé¿ö£¬Ò²¾ÍÊÇ˵µ±µçÄÔ»òÍæ¼ÒÓÐÈý¸ö×Ó»òËĸö×ÓÁ¬³ÉÒ»Ïßʱ£¬ÎÒÃÇͨ¹ý¼ÓÇ¿Ëã·¨½«µ±Ç°ÓëÈý¸ö×Ó»òËĸö×ÓÓйصĿոñµÄ·ÖÖµÌá¸ß£¬´Ó¶ø¿ÉÒÔÃÖ²¹Õâһȱº¶¡£

ËÄ£¬¹¥»÷Óë·ÀÊØ

       ÒÔÉϵķ½Ê½£¬ÊÂʵÉϼÆËã»úÖ»ÊǼÆËã³öÁË×î¼ÑµÄ¹¥»÷λÖã¬ÎªÁË·ÀÊØÎÒÃÇ»¹Ó¦¼ÆË㵱ǰÍæ¼ÒµÄ×î¼ÑµÄ¹¥»÷λÖá£ÕâÑùÓÐʲôÓÃÄØ£¿µÀÀíºÜ¼òµ¥£¬Èç¹ûÍæ¼Ò×î¼Ñ¹¥»÷λÖõķÖÊý´óÓÚ¼ÆËã»ú×î¼Ñ¹¥»÷λÖÃÉϵķÖÊý£¬ÄÇô¼ÆËã»ú¾Í½«ÏÂÒ»²½µÄÆå×Ó°ÚÔÚÍæ¼ÒµÄ×î¼Ñ¹¥»÷λÉÏÒÔ×èÖ¹Íæ¼ÒµÄ½ø¹¥£¬·ñÔò¼ÆËã»ú±ã½«Æå×ÓÏÂÔÚ×Ô¼ºµÄ×î¼Ñ¹¥»÷λÖÃÉϽøÐй¥»÷¡£

       ÊÂʵÉÏ£¬Õâ¸öAI¹¹ÏëÊǺÜÇ¿´óµÄÈç¹ûÄã²»ÊǺÜÀ÷º¦µÄÎå×ÓÆå¸ßÊֵĻ°£¬¿ÉÄܺܿì»á±»¼ÆËã»ú´ò°Ü¡£ÎÒÔÚÁªÖÚÉÏ¿ÉÊÇÖм¶ÆåÊÖ°¡£¬¸úÕâÖÖ¹¹Ïë´òµÄʱºòʤÂÊÒ²²»ÊǺܸߡ£

            µÚ¶þ²¿·Ö    ʹÓÃvb.net±àдÎå×ÓÆå

Ò»£¬±àдǰµÄ×¼±¸£º

1£¬ ÓüÆËã»úµÄ˼ÏëÃèÊöÕû¸öÏÂÆåµÄ¹ý³Ì¡£

¿¼ÂDz½Ö裺

£¨1£©ÎªÁ˼ò±ãÎÒÃÇ¿ÉÒÔÏÈÈõçÄÔÏÈ×ßµÚÒ»²½Æ壬µçÄÔÿ×ßÒ»²½¾Í»á·âµôÐí¶àÍæ¼ÒµÄ»ñʤ¿ÉÄÜÇé¿ö¡£

£¨2£©µ±Íæ¼Ò×ßÆåµÄʱºòÎÒÃÇÊ×ÏÈÓ¦¸Ã¿¼ÂÇÍæ¼Ò×ßÆåµÄºÏ·¨ÐÔ¡£

£¨3£©Èç¹ûºÏ·¨£¬ÄÇôÍæ¼ÒÒ²»á·âµôÐí¶àµçÄԵĻñʤµÄ¿ÉÄÜÇé¿ö¡£

£¨4£©µçÄÔµÄ˼¿¼Â·¾¶£ºÊ×ÏÈÅжϵ±Ç°Íæ¼ÒºÍµçÄÔµÄËùÓлñʤ×éºÏÊÇ·ñÐèÒª½øÐмÓÇ¿¸³Öµ£¬

ÊǽøÐмÓÇ¿¸³Öµ£¬·ñÔò½øÐÐÆÕͨµÄ¸³Öµ¡£

£¨5£©±È½Ïµ±Ç°Íæ¼ÒºÍµçÄÔË­µÄ·ÖÖµ×î´ó¡£½«·ÖÖµ×î´óµÄµã×÷ΪµçÄÔµÄÏÂÒ»²½×ß·¨¡£

2£¬ ÀûÓÃvb.net´°ÌåºÍͼÐι¤¾ß½¨Á¢Îå×ÓÆåµÄÆåÅ̽çÃæ¡£

£¨1£©Ìí¼ÓÒ»¸öpicturebox¿Ø¼þ¡£

       ×÷ÓãºÊ¹ÓÃpicturebox¿Ø¼þ»æÖÆÆå×ÓºÍÆåÅÌ

£¨2£©Ìí¼ÓÒ»¸ölabel¿Ø¼þ¡£

       ×÷ÓãºÏÔʾµ±Ç°µÄ»ñʤ±êÖ¾£¬Ò²¾ÍÊǵ±Ä³Ò»·½»ñʤ»òºÍÆåʱÏÔʾ´Ë±êÇ©¡£

£¨3£©Ìí¼ÓÒ»¸ömainmenu¿Ø¼þ¡£

       ×÷Ó㺿ØÖÆÓÎÏ·µÄ¿ªÊ¼»ò½áÊø¡£

£¨4£©Ìí¼ÓÒ»¸ömediaplay×é¼þ¡£

       ×÷ÓãºÊ¹³ÌÐò¿ÉÒÔ²¥·ÅÒôÀÖ¡£

3£¬ÉèÖÃÕûÌå¿ò¼Û

    ÎÒÃDzÉÈ¡10*10µÄÆåÅÌ£¬ÎªÖ÷ÒªµÄƽ̨¡£ÀûÓÃÊý×鶨ÒåÕû¸öÆåÅÌ×ÀÃ棬ÀûÓÃÊý×鶨Òå»ñʤ×éºÏÒÔ¼°»ñʤ±êÖ¾µÈ¡£

¶þ£¬ÉùÃ÷È«¾ÖÊý×éºÍ±äÁ¿

¶¨ÒåÐéÄâ×ÀÃ棺

Dim table(9, 9) As Integer

¶¨Ò嵱ǰÍæ¼Ò×ÀÃæ¿Õ¸ñµÄ·ÖÊý£º

Dim pscore(9, 9) As Integer

¶¨Ò嵱ǰµçÄÔ×ÀÃæ¿Õ¸ñµÄ·ÖÊý£º

Dim cscore(9, 9) As Integer

¶¨ÒåÍæ¼ÒµÄ»ñʤ×éºÏ£º

Dim pwin(9, 9, 191) As Boolean

¶¨ÒåµçÄԵĻñʤ×éºÏ£º

Dim cwin(9, 9, 191) As Boolean

¶¨ÒåÍæ¼ÒµÄ»ñʤ×éºÏ±êÖ¾£º

Dim pflag(191) As Boolean

¶¨ÒåµçÄԵĻñʤ×éºÏ±êÖ¾£º

Dim cflag(191) As Boolean

¶¨ÒåÓÎÏ·ÓÐЧ±êÖ¾£º

Dim theplayflag As Boolean

Èý£¬³õʼ»¯ÓÎÏ·

  '*****************************************************************************

  '** Ä£¿éÃû³Æ: initplayenvironment

  '**

  '** ÃèÊö:    ´Ëº¯ÊýÖ÷Òª¹¦ÄÜÈçÏÂ:

  '**         1. ÉèÖñ³¾°ÒôÀÖ¡£

  '**         2. ÉèÖÃÓÎϷ״̬ÓÐЧ¡£

  '**         3. ³õʼ»¯ÓÎϷ״̬±êÇ©¡£

  '**         4. Ö±½ÓÖ¸¶¨µçÄԵĵÚÒ»²½×ß·¨¡£

  '**         5. ³õʼ»¯»ù±¾µÃ·Ö×ÀÃæ¡£

  '**         6. µçÄÔºÍÍæ¼Ò»ñʤ±êÖ¾³õʼ»¯¡£

  '**         7. ³õʼ»¯ËùÓлñʤ×éºÏ¡£

  '**         8. ÖØÐÂÉ趨Íæ¼ÒµÄ»ñʤ±êÖ¾¡£

  '**

  '*****************************************************************************

  Sub initplayenvironment()

    player.FileName = ".\music\zhyu01.mid"

    player.Play()

    theplayflag = True

    'ÓÎÏ·ÓÐЧ

    Label1.Visible = False

    'ÓÎϷ״̬±êÇ©²»ÏÔʾ

    PictureBox1.Refresh()

    'Çå¿Õpicturebox1µÄÄÚÈÝ

    yuandian(130, 130)

    'µ÷Óûæͼº¯Êý»æÖƵ±Ç°µçÄÔÏÈ×ßµÄλÖÃ

    Dim i, j, m, n As Integer

    For i = 0 To 9

      For j = 0 To 9

        table(i, j) = 0

      Next

    Next

    '×ÀÃæ³õʼ»¯

    For i = 0 To 191

      pflag(i) = True

      cflag(i) = True

    Next

    '»ñʤ±êÖ¾³õʼ»¯

    table(4, 4) = 1

    'ÓÉÓÚÎÒÃÇÉ趨µçÄÔÏÈÊÖ£¬²¢ÏÂÁË4£¬4λËùÒÔ½«ÆäÖµÉèΪ1

    ''' ********            ³õʼ»¯»ñʤ×éºÏ         ********

    n = 0

    For i = 0 To 9

      For j = 0 To 5

        For m = 0 To 4

          pwin(j + m, i, n) = True

          cwin(j + m, i, n) = True

        Next

        n = n + 1

      Next

    Next

    For i = 0 To 9

      For j = 0 To 5

        For m = 0 To 4

          pwin(i, j + m, n) = True

          cwin(i, j + m, n) = True

        Next

        n = n + 1

      Next

    Next

    For i = 0 To 5

      For j = 0 To 5

        For m = 0 To 4

          pwin(j + m, i + m, n) = True

          cwin(j + m, i + m, n) = True

        Next

        n = n + 1

      Next

    Next

    For i = 0 To 5

      For j = 9 To 4 Step -1

        For m = 0 To 4

          pwin(j - m, i + m, n) = True

          cwin(j - m, i + m, n) = True

        Next

        n = n + 1

      Next

    Next

    ''' ********            ³õʼ»¯»ñʤ×éºÏ½áÊø        ********

    For i = 0 To 191

      If pwin(4, 4, i) = True Then

        pflag(i) = False

      End If

    Next

    'ÓÉÓÚµçÄÔÒÑÏÂÁË4£¬4λËùÒÔÎÒÃÇÐèÒªÖØÐÂÉ趨Íæ¼ÒµÄ»ñʤ±êÖ¾

  End Sub

  ËÄ£¬´¦ÀíÊó±êʼþ

  '*****************************************************************************

  '** Ä£¿éÃû³Æ: themousedown

  '**

  '** ÃèÊö:    ´Ëº¯ÊýÖ÷ҪʵÐÐÒÔϹ¦ÄÜ£º

  '**         1. Åж¨µ±Ç°ÓÎÏ·±êÖ¾ÊÇ·ñÓÐЧ¡£

  '**         2. ½«Êµ¼Ê×ø±êת»¯³ÉÐéÄâ×ø±ê¡£

  '**         3. »æÖÆÍæ¼ÒµÄÆå×Ó¡£

  '**         4. Ö´Ðмì²é»ñʤº¯Êý¡£

  '**         5. Ö´ÐеçÄÔËã·¨º¯Êý¡£

  '**

  '*****************************************************************************

  Sub themousedown(ByVal x As Integer, ByVal y As Integer)

    If theplayflag = False Then

      Exit Sub

    End If

    '¼ì²éÓÎϷ״̬ÊÇ·ñÓÐЧ

    Dim i, j As Integer

    Dim zhx, zhy As Integer

    zhx = Int((x - 10) / 30)

    zhy = Int((y - 10) / 30)

    For i = 0 To 9

      For j = 0 To 9

        If table(zhx, zhy) > 0 Then

          Exit Sub

        End If

      Next

    Next

    '¼ì²éµ±Ç°Êó±êµã»÷µÄ¸ñ×ÓÊÇ·ñÓÐЧ

    Dim mycolor As Color

    Dim g As System.Drawing.Graphics

    g = PictureBox1.CreateGraphics

    mycolor = Color.White

    Dim brush1 As System.Drawing.Brush = New SolidBrush(mycolor)

    g.FillEllipse(brush1, zhx * 30 + 10, zhy * 30 + 10, 30, 30)

    '»æÖÆÍæ¼ÒµÄÆå×Ó

    table(zhx, zhy) = 2

    For i = 0 To 191

      If cwin(zhx, zhy, i) = True Then

        cflag(i) = False

      End If

    Next

    'ÖØÉèµçÄԵĻñʤ±êÖ¾

    checkwin()

    '¼ì²éµ±Ç°Íæ¼ÒÊÇ·ñ»ñʤ

    diannao()

    'µ÷ÓõçÄÔËã·¨

  End Sub

Î壬»ñʤ¼ì²éËã·¨¡£

  '*****************************************************************************

  '** Ä£¿éÃû³Æ: checkwin

  '**

  '** ÃèÊö:    ´ËÄ£¿éÖ´ÐÐÒÔϹ¦ÄÜ:

  '**         1. ¼ì²éÊÇ·ñºÍÆå¡£

  '**         2. ¼ì²éµçÄÔÊÇ·ñ»ñʤ¡£

  '**         3. ¼ì²éÍæ¼ÒÊÇ·ñ»ñʤ¡£

  '**

  '*****************************************************************************

  Sub checkwin()

    Dim i, j, k, m, n As Integer

    Dim ca As Integer

    Dim pa As Integer

    Dim cnormal As Integer = 0

    For i = 0 To 191

      If cflag(i) = False Then

        cnormal = cnormal + 1

      End If

    Next

    If cnormal = 190 Then

      Label1.Visible = True

      Label1.Text = "ºÍÆ壬ÇëÖØпªÊ¼£¡"

      PictureBox1.Refresh()

      theplayflag = False

      Exit Sub

    End If

    'É趨ºÍÆå¹æÔò

    For i = 0 To 191

      If cflag(i) = True Then

        ca = 0

        For j = 0 To 9

          For k = 0 To 9

            If table(j, k) = 1 Then

              If cwin(j, k, i) = True Then

                ca = ca + 1

              End If

            End If

          Next

        Next

        If ca = 5 Then

          Label1.Visible = True

          Label1.Text = "µçÄÔ»ñʤ,ÇëÖØпªÊ¼"

          PictureBox1.Refresh()

          theplayflag = False

          Exit Sub

        End If

      End If

    Next

    '¼ì²éµçÄÔÊÇ·ñ»ñʤ

    For i = 0 To 191

      If pflag(i) = True Then

        pa = 0

        For j = 0 To 9

          For k = 0 To 9

            If table(j, k) = 2 Then

              If pwin(j, k, i) = True Then

                pa = pa + 1

              End If

            End If

          Next

        Next

        If pa = 5 Then

          Label1.Visible = True

          Label1.Text = "Íæ¼Ò»ñʤ,ÇëÖØпªÊ¼"

          PictureBox1.Refresh()

          theplayflag = False

          Exit Sub

        End If

      End If

    Next

    '¼ì²éÍæ¼ÒÊÇ·ñ»ñʤ

  End Sub

Áù£¬µçÄÔËã·¨£¨1£©

  '*****************************************************************************

  '** Ä£¿éÃû³Æ: diannao

  '**

  '** ÃèÊö:  ´Ë³ÌÐòÖ÷ÒªÖ´ÐÐÒÔϹ¦ÄÜ£º

  '**         1. ³õʼ»¯¸³ÖµÏµÍ³¡£

  '**         2. ¸³Öµ¼ÓÇ¿Ëã·¨¡£

  '**         3. ¼ÆËãµçÄÔºÍÍæ¼ÒµÄ×î¼Ñ¹¥»÷λ¡£

  '**         4. ±È½ÏµçÄÔºÍÍæ¼ÒµÄ×î¼Ñ¹¥»÷λ²¢¾ö¶¨µçÄÔµÄ×î¼Ñ²ßÂÔ¡£

  '**         5. Ö´Ðмì²é»ñʤº¯Êý¡£

  '**

'*****************************************************************************

  Sub diannao()

    Dim i, j, k, m, n As Integer

    Dim dc As Integer

    Dim cab As Integer

    Dim pab As Integer

    For i = 0 To 9

      For j = 0 To 9

        pscore(i, j) = 0

        cscore(i, j) = 0

      Next

    Next

    '³õʼ»¯¸³ÖµÊý×é

    ''' ********            µçÄÔ¼ÓÇ¿Ëã·¨        ********

    For i = 0 To 191

      If cflag(i) = True Then

        cab = 0

        For j = 0 To 9

          For k = 0 To 9

            If table(j, k) = 1 Then

              If cwin(j, k, i) = True Then

                cab = cab + 1

              End If

            End If

          Next

        Next

        Select Case cab

          Case 3

            For m = 0 To 9

              For n = 0 To 9

                If table(m, n) = 0 Then

                  If cwin(m, n, i) = True Then

                    cscore(m, n) = cscore(m, n) + 5

                  End If

                End If

              Next

            Next

          Case 4

            For m = 0 To 9

              For n = 0 To 9

                If table(m, n) = 0 Then

                  If cwin(m, n, i) = True Then

                    yuandian(m * 30 + 10, n * 30 + 10)

                    table(m, n) = 1

                    For dc = 0 To 191

                      If pwin(m, n, dc) = True Then

                        pflag(dc) = False

                        checkwin()

                        Exit Sub

                      End If

                    Next

                  End If

                End If

              Next

            Next

        End Select

      End If

    Next

    For i = 0 To 191

      If pflag(i) = True Then

        pab = 0

        For j = 0 To 9

          For k = 0 To 9

            If table(j, k) = 2 Then

              If pwin(j, k, i) = True Then

                pab = pab + 1

              End If

            End If

          Next

        Next

        Select Case pab

          Case 3

            For m = 0 To 9

              For n = 0 To 9

                If table(m, n) = 0 Then

                  If pwin(m, n, i) = True Then

                    pscore(m, n) = pscore(m, n) + 30

                  End If

                End If

¹ØÓÚÎÒÃÇ / ¸øÎÒÁôÑÔ / °æȨ¾Ù±¨ / Òâ¼û½¨Òé / ÍøÕ¾±à³ÌQQȺ   
Copyright ©2003- 2024 Lihuasoft.net webmaster(at)lihuasoft.net ¼ÓÔØʱ¼ä 0.00422