Madza91 Posted May 5, 2008 Posted May 5, 2008 (edited) Hallo everybody, i maded this little game because i have been bored Not much to say, just enter number between 1 and 1000 and hit ENTER or click on "Try" button ...and find out what's mysterious number (click on "reset" button for new game with a new mysterious number)Source is attached below.btw, my personal record is 6 n3_Number_Hide_.au3Down is fixed version: click Edited May 7, 2008 by n3nE [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
MerkurAlex Posted May 5, 2008 Posted May 5, 2008 umm... this is really basic.Maybe you missed made in 10 minutes or whatever it was and reading his post i think it was supposed to be basic... [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]
jvanegmond Posted May 5, 2008 Posted May 5, 2008 Thanks for the game. Here's one for you. #include <GUIConstants.au3> GUICreate("Number Game", 200, 100) GUICtrlCreateLabel("Guess a number between 1 and 10.", 10, 10) $nInput = GUICtrlCreateInput("", 10, 50) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $nInput $n = Number(GUICtrlRead($nInput)) While 1 $i = Random(1,10,1) If $i <> $n Then MsgBox(0, "Number Game", "WRONG!!! The number was " & $i & @CRLF & @CRLF & "Keep trying!") ExitLoop EndIf WEnd EndSwitch WEnd github.com/jvanegmond
jvanegmond Posted May 5, 2008 Posted May 5, 2008 (edited) I noticed your "Try" does not reset when I click Reset. The "Record" is broken. Because I had a record of 3, which was reset to 8 later. $iLow = 1 $iMax = 1000 While 1 $iGuess = Round(($iLow+$iMax)/2) ControlSetText("n3 Number Hide", "", "Edit1", $iGuess) ControlClick("n3 Number Hide", "", "Button2") Sleep(100) ;; Aww too eeet be slow $sRead = ControlGetText("n3 Number Hide", "", "Static3") ;ConsoleWrite("iMax = " & $iMax & @CRLF & "iLow = " & $iLow & @CRLF & "iGuess = "& $iGuess & @CRLF & "sRead = " & $sRead & @CRLF & @CRLF) ;; Use this if you want to see what's going on If StringInStr($sRead,"bigger than") Then $iLow = $iGuess Else $iMax = $iGuess EndIf If StringInStr($sRead, "Congratulations") Then $iLow = 1 $iMax = 1000 ControlClick("n3 Number Hide", "", "Button1") Sleep(100) EndIf WEnd Edited May 5, 2008 by Manadar github.com/jvanegmond
Madza91 Posted May 6, 2008 Author Posted May 6, 2008 oh sorry, i missed that.. here is fixed version attached below Now works without bugs, i think n3_Number_Hide_.au3 [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
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