Hok Posted May 17, 2008 Posted May 17, 2008 Hey everyone. This is my first contribution, but it isn't very useful. It is a simple GuessMyNumber game where you guess a number between 1 and 100. Check it out and please give me feedback. Hok GuessMyNumberGUI.au3
TnTProductions Posted May 17, 2008 Posted May 17, 2008 cool for a newbage agreed "FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"
d4rk Posted May 17, 2008 Posted May 17, 2008 8 tries for "21", I'm OK [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys
Kip Posted May 17, 2008 Posted May 17, 2008 6 tries for 35 MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
Kip Posted May 17, 2008 Posted May 17, 2008 (edited) Edited May 17, 2008 by Kip MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
i542 Posted May 17, 2008 Posted May 17, 2008 (edited) expandcollapse popupFunc Test() $Guess=GUICtrlRead($input1) If ($guess > $Random) then $Label2 = GUICtrlCreateLabel("Status: Checking...", 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") Sleep(Random(500, 1000)) $Label2 = GUICtrlCreateLabel("Status: The Number is Lower!", 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") $Counter=$Counter+1 EndIf If ($guess < $Random) then $Label2 = GUICtrlCreateLabel("Status: Checking...", 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") Sleep(Random(500, 1000)) $Label2 = GUICtrlCreateLabel("Status: The Number is Higher!", 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") $Counter=$Counter+1 EndIf If ($guess == $Random) then $Label2 = GUICtrlCreateLabel("Status: Checking...", 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") Sleep(Random(500, 1000)) If $Counter<5 Then $Phrase=" You are pro!" EndIf If $Counter >= 5 Then $Phrase=" You are OK..." EndIf If $Counter>10 Then $Phrase=" You are awful!" EndIf $Label2 = GUICtrlCreateLabel("Nice! You got it! It took you " &$Counter &" tries!" &$Phrase, 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") $Counter=$Counter+1 Sleep(2000) EndIf EndFuncNow it can say "You're a pro" Edited May 17, 2008 by i542 I can do signature me.
Kip Posted May 17, 2008 Posted May 17, 2008 and what if you have 5? the script only uses: Larger than 5, and smaller than 5. Not: if larger or equals. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
Hok Posted May 17, 2008 Author Posted May 17, 2008 I'm seeing a lot of... I got ___ tries for ___. Any better way I could've written the code?
Vossen Posted May 19, 2008 Posted May 19, 2008 (edited) expandcollapse popupFunc Test() $Guess = GUICtrlRead($Input1) If $Guess > 100 or $Guess < 1 Then MsgBox(64,"Guess invalid","The guess has to be a number from 1 to 100. " & $Guess & " is not within that range.") Else If ($Guess > $Random) Then $Label2 = GUICtrlCreateLabel("Status: Checking...", 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") Sleep(Random(500, 1000)) $Label2 = GUICtrlCreateLabel("Status: The Number is Lower!", 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") $Counter = $Counter + 1 EndIf If ($Guess < $Random) Then $Label2 = GUICtrlCreateLabel("Status: Checking...", 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") Sleep(Random(500, 1000)) $Label2 = GUICtrlCreateLabel("Status: The Number is Higher!", 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") $Counter = $Counter + 1 EndIf If ($Guess == $Random) Then $Label2 = GUICtrlCreateLabel("Status: Checking...", 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") Sleep(Random(500, 1000)) If $Counter < 5 Then $Phrase = " You are pro!" EndIf If $Counter < 10 Then $Phrase = " You are OK..." EndIf If $Counter > 10 Then $Phrase = " You are awful!" EndIf $Label2 = GUICtrlCreateLabel("Nice! You got it! It took you " & $Counter & " tries!" & $Phrase, 8, 168, 376, 48) GUICtrlSetFont(-1, 15, 800, 0, "Toxica") $Counter = $Counter + 1 Sleep(2000) EndIf EndIf EndFunc Now it will give an error if the guess in invalid. Edited May 19, 2008 by Vossen
Gillboss Posted May 19, 2008 Posted May 19, 2008 5 tries xD i have secret technique, i cant public it
AlmarM Posted May 20, 2008 Posted May 20, 2008 Nice! You got it! It took you 1 tries! You are OK... It was 5 >.< Nice program 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.
ACS Posted May 21, 2008 Posted May 21, 2008 Nice first shot for a program. I have a few suggestion to make it a bit more user-friendly. After a guess, the program should clear the input field so the user can just type another guess. Of course the message should report the guessed number, i.e. "The number is higher than (guess)!" After the user correctly guesses the number, the "Guess" button should reset the game so the user can play again. For example, the button text can change to "New game" or something similar, and when the user clicks it the button reverts back to its original "Guess" state and the status message informs the user its ready for a new guess. On that same note, when the program first starts up the status message should say it's waiting for the user to make a guess. Just some suggestions from a GUI nazi.
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