AlmarM Posted June 30, 2009 Share Posted June 30, 2009 (edited) Hello,Admire the magic! expandcollapse popupGlobal $Explaination = "Welcome to this little Number Game." & @CRLF & @CRLF & "Follow these steps:" & _ @CRLF & "Step 1.: Select a number from 11 - 99, and add a 0 to it. (Number 1)" & _ @CRLF & "Step 2.: Select a number from 2 - 9 (Number 2)" & _ @CRLF & "Step 3.: Now do 'Number 2' × 9 (Number 3)" & _ @CRLF & "Step 4.: Now do 'Number 1' - 'Number 3' (Number 4)" & _ @CRLF & "Step 5.: Now put the 'Number 4' into the Input." & _ @CRLF & "Step 6.: Now press the button and admire the magic!" $GUI = GUICreate("Number Game", 340, 170) GUICtrlCreateLabel($Explaination, 10, 10) $Input = GUICtrlCreateInput("", 100, 135, 25, 20) $Button = GUICtrlCreateButton("Magic!", 130, 133, 100) GUISetState() While 1 $nMsg = GUIGetMsg() Select Case $nMsg = -3 Exit Case $nMsg = $Button $Read = GUICtrlRead($Input) If $Read = "" Then MsgBox(16, "ERROR", "Please fill in the number.") Else If StringLen($Read) = 2 Then $Left = Number(StringLeft($Read, 1)) $Right = Number(StringRight($Read, 1)) ElseIf StringLen($Read) = 3 Then $Left = Number(StringLeft($Read, 2)) $Right = Number(StringRight($Read, 1)) EndIf $Result = $Left + $Right MsgBox(64, "Result", "Your first number was: " & $Result) EndIf EndSelect WEndAlmarMEDIT: Updated Edited June 30, 2009 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Andreik Posted June 30, 2009 Share Posted June 30, 2009 (edited) A little inattention, is last number(Num1-Num3) not number 3 that should be put in the input. EDIT: And isn't so magic, it's just a beautiful part of math. BTW is very nice. Edited June 30, 2009 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
martin Posted June 30, 2009 Share Posted June 30, 2009 Hello, Admire the magic! expandcollapse popupGlobal $Explaination = "Welcome to this little Number Game." & @CRLF & @CRLF & "Follow these steps:" & _ @CRLF & "Step 1.: Select a number from 11 - 99, and add a 0 to it. (Number 1)" & _ @CRLF & "Step 2.: Select a number from 2 - 9 (Number 2)" & _ @CRLF & "Step 3.: Now do 'Number 2' × 9 (Number 3)" & _ @CRLF & "Step 4.: Now do 'Number 1' - 'Number 3'" & _ @CRLF & "Step 5.: Now put the 'Number 3' into the Input." & _ @CRLF & "Step 6.: Now press the button and admire the magic!" $GUI = GUICreate("Number Game", 340, 170) GUICtrlCreateLabel($Explaination, 10, 10) $Input = GUICtrlCreateInput("", 100, 135, 25, 20) $Button = GUICtrlCreateButton("Magic!", 130, 133, 100) GUISetState() While 1 $nMsg = GUIGetMsg() Select Case $nMsg = -3 Exit Case $nMsg = $Button $Read = GUICtrlRead($Input) If $Read = "" Then MsgBox(16, "ERROR", "Please fill in the number.") Else If StringLen($Read) = 2 Then $Left = Number(StringLeft($Read, 1)) $Right = Number(StringRight($Read, 1)) ElseIf StringLen($Read) = 3 Then $Left = Number(StringLeft($Read, 2)) $Right = Number(StringRight($Read, 1)) EndIf $Result = $Left + $Right MsgBox(64, "Result", "Your first number was: " & $Result) EndIf EndSelect WEnd AlmarM EDIT: Updated Maybe it should be @CRLF & "Step 4.: Now do 'Number 1' - 'Number 3' (Number 4)" & _ @CRLF & "Step 5.: Now put the 'Number 4' into the Input." & _ Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
AlmarM Posted June 30, 2009 Author Share Posted June 30, 2009 Maybe it should be @CRLF & "Step 4.: Now do 'Number 1' - 'Number 3' (Number 4)" & _ @CRLF & "Step 5.: Now put the 'Number 4' into the Input." & _Ah yes Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now