Jump to content

Search the Community

Showing results for tags 'fifteen game'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Local $mx, $b[16], $bx[16], $by[16], $bn[16], $win, $enf, $rnd[16], $fr, $loop, $nMsg mix() While $nMsg <> -3 $nMsg = GUIGetMsg() If $nMsg = $mx Then mix() ; Botão mix If Not $loop Then For $i = 0 To 15 ; movimenta os botões selecionados Switch $nMsg Case $b[$i] GUICtrlSetBkColor($b[$i], 0x00cc33) Sleep(190) GUICtrlSetBkColor($b[$i], 0xffffff) if $i = 0 or $i = 4 Or $i = 8 Or $i = 12 Then pos($i, 2, 1, 1) if $i = 1 or $i = 5 Or $i = 9 Or $i = 13 Then pos($i, 1, 1, 1) if $i = 2 or $i = 6 Or $i = 10 Or $i = 14 Then pos($i, 0, 1, 1) if $i = 1 or $i = 5 Or $i = 9 Or $i = 13 Then pos($i, 0, -1, -1) if $i = 2 or $i = 6 Or $i = 10 Or $i = 14 Then pos($i, 1, -1, -1) if $i = 3 or $i = 7 Or $i = 11 Or $i = 15 Then pos($i, 2, -1, -1) if $i < 4 Then pos($i, 2, 4, 4) if $i > 3 And $i < 8 Then pos($i, 1, 4, 4) if $i > 7 And $i < 12 Then pos($i, 0, 1, 4) if $i > 3 And $i < 8 Then pos($i, 0, -4, -4) if $i > 7 And $i < 12 Then pos($i, 1, -4, -4) if $i > 11 Then pos($i, 2, -4, -4) Case -3 Exit EndSwitch GUICtrlSetPos($b[$i], $bx[$i], $by[$i]) ; Atualiza as posições dos botões If $bn[$i] <> $i + 1 Then $win = 1 ; Verifica se os botãoes estão ordenados Next EndIf If Not $win Then ; Animaçã da vitória If $loop < 2 Then For $i = 0 To 30 If $i < 16 Then GUICtrlSetBkColor($b[$i], Random(100, 10000, 1) * 5572 + $i * Random(100, 10000, 1)) If $i > 15 Then GUICtrlSetBkColor($b[$i-16], 0xffffff) Beep(Random(30, 100, 1) * $i, 250) Next EndIf $loop += 1 EndIf $win = 0 WEnd Func pos($n, $p, $sinal, $step) ; combinação para movimento dos botões For $i = $p To 0 Step - 1 if $bn[$n + $sinal * $i + $step] = 16 Then $aux = $b[$n + $sinal * $i] $b[$n + $sinal * $i]= $b[$n + $sinal * $i + $step] $b[$n + $sinal * $i + $step] = $aux $aux = $bn[$n + $sinal * $i] $bn[$n + $sinal * $i] = $bn[$n + $sinal * $i + $step] $bn[$n + $sinal * $i + $step] = $aux EndIf Next $nMsg = 0 EndFunc Func mix() ;Cria e embaralha os botões GUIDelete($fr) $fr = GUICreate("Autoit", 510, 560, 300, 50) GUISetBkColor(0xe8c70e) GUICtrlCreateLabel("JOGO DOS 15", 30, 15, 430, 70, 1) GUICtrlSetFont(-1, 54, 800, 0, "MS Sans Serif") $bt = GUICtrlCreateButton("", 38, 78, 434, 429) GUIctrlSetState(-1,128) $mx = GUICtrlCreateLabel("M i x", 422, 530, 50, 20, 1, 1) GUISetState() For $i = 0 To 3 ;gera as posições dos botões For $j = 0 To 3 $bx[$j + $i * 4] = $i * 3 + $j * 110 + 40 - 3 * $i $by[$j + $i * 4] = $i * 3 + $i * 105 + 80 Next Next $win = 0 $loop = 0 For $i = 0 to 15 Do $b[$i] = 0 $enf = 1 $rnd[$i] = Random(0, 15, 1) For $j = 0 To $i For $k = 0 To $i If $j <> $k And $rnd[$k] = $rnd[$j] Then $enf = 0 Next Next Until $enf $bn[$i] = $rnd[$i] + 1 If $rnd[$i] < 15 Then $b[$i] = GUICtrlCreateButton($rnd[$i] + 1, $bx[$i], $by[$i], 100, 100) GUICtrlSetBkColor($b[$i], 0xffffff) GUICtrlSetFont($b[$i], 50, 800, 0, "MS Sans Serif") EndIf Next EndFunc
×
×
  • Create New...