Jump to content
Sign in to follow this  
quick_sliver007

Hangman V1.1

Recommended Posts

Here it is. version 1.1 . Replys welcome.

**Edit** Bug found and fixed

There was a problem with the deleting all of the labels and remaking them. After playing 10-17 games the labels would not re- create. Fix by seting data instead of deleting then remaking. The download is updated to the fixed version. Lets hope this is the final version.

**edit**

fixed a few small details.The download is updated to the fixed version.

HANGMAN_Version_1.1.zip

Edited by quick_sliver007

.

Share this post


Link to post
Share on other sites

Func _hint() and _CheckForWin() can be shortened to this..

Func _CheckForWin()
    Local $read_Labels[42]
    For $c = 1 To 41
        $read_Labels[$c] = GUICtrlRead($labels[$c])
    Next
    $read_Labels[0] = ""
    $Count = 0
    Do
        $Count = $Count + 1
        $read_Labels[0] = $read_Labels[0] & $read_Labels[$Count]
    Until $Count = 41
    If $read_Labels[0] = $Word Then
        _win()
    EndIf
EndFunc  ;==>_CheckForWin
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func _hint()
    If $Pic_count = 6 Then
        MsgBox(0, "It's too late for a hint", "The penalty would hang him for sure")
    ElseIf $Pic_count > 2 Then
        Local $read_Labels[42]
        For $c = 1 To 41
            $read_Labels[$c] = GUICtrlRead($labels[$c])
        Next
        $read_Labels[0] = ""
        $Count = 0
        Do
            $Count = $Count + 1
            $read_Labels[0] = $read_Labels[0] & $read_Labels[$Count]
        Until $Count = 41
        $Find_Blank = StringInStr($read_Labels[0], "_")
        $Letter_Hint = StringSplit($Word, "")
        $Pic_count = $Pic_count + 1
        GUICtrlSetImage($Pic, $Pic_count & ".JPG")
        MsgBox(0, "Your hint is", StringUpper($Letter_Hint[$Find_Blank]))
    Else
        MsgBox(0, "Try a letter or more first.", "Hint unavailable at present time.")
    EndIf
EndFunc  ;==>_hint


.

Share this post


Link to post
Share on other sites

qs, did you include the above changes into the v1.1? Or is this something you just examined after putting out the code?

Cheers... :(

Share this post


Link to post
Share on other sites

qs, did you include the above changes into the v1.1? Or is this something you just examined after putting out the code?

Cheers...  :(

<{POST_SNAPBACK}>

I can't remember at the moment but both ways works just fine. Just less lines of codes.

.

Share this post


Link to post
Share on other sites

It is implemented in your current release..! But I am happy to see that modification. I was looking at attacking it myself but did not do it. You can only mod so much before you get brain fry..

Cheers..

Share this post


Link to post
Share on other sites

It is implemented in your current release..! But I am happy to see that modification. I was looking at attacking it myself but did not do it. You can only mod so much before you get brain fry..

Cheers..

<{POST_SNAPBACK}>

The hardest part is all of the scrolling up and down the script. I don't type over 500 lines of anything much and typing 500 lines of code will fry the brains. I am glad it's over. LOL

I Just hope this script helps some newbies get a feel of autoit 3 and serve as a good learning tool. Now only if I could get a few people to get click happy on that donate button. :(


.

Share this post


Link to post
Share on other sites

What editor are you using?

When the code get long that is when you need to know a simple technique, 1) a small "main module", this is where your main program runs from; 2) Functions or include file, this help break the program down into manage parts.

The way you cleaned up the code on the latest shows both of these techniques.

You think 500 lines in AutoIt is bad, try 2000 lines of text in a batch file. Now that was a big mess. It was a cheap installer which installed, verified, configured, updated, and logged all transactions. That was the good old days with DOS as your main OS.

Yeah, I thought the Donate Button was a nice touch! :( In addition to your donate button you should implement one for AutoIt as well. We all need to do or part to keep the AutoIt Team running..

Cheers... :cool:

Share this post


Link to post
Share on other sites

What editor are you using?

When the code get long that is when you need to know a simple technique, 1) a small "main module", this is where your main program runs from; 2) Functions or include file, this help break the program down into manage parts.

The way you cleaned up the code on the latest shows both of these techniques.

You think 500 lines in AutoIt is bad, try 2000 lines of text in a batch file. Now that was a big mess. It was a cheap installer which installed, verified, configured, updated, and logged all transactions. That was the good old days with DOS as your main OS.

Yeah, I thought the Donate Button was a nice touch! :( In addition to your donate button you should implement one for AutoIt as well. We all need to do or part to keep the AutoIt Team running..

Cheers... :cool:

<{POST_SNAPBACK}>

I use SciTe for my editor. 2000 lines of code is alot. I think I have seen like two or three that long in autoit. I never did any batch file. This is the only scripting(programming) language I know other then a little basic on the old IBM computers, just a general ideal of C++ and a general ideal of VB. If the donations start rolling in I will be sure to give some back. :(

.

Share this post


Link to post
Share on other sites

I use SciTe for my editor. 2000 lines of code is alot. I think I have seen like two or three that long in autoit. I never did any batch file. This is the only scripting(programming) language I know other then a little basic on the old IBM computers, just a general ideal of C++ and a general ideal of VB. If the donations start rolling in I will be sure to give some back.  :(

<{POST_SNAPBACK}>

As far as programming I am always looking for a non-M$ solution. I am still in search of a similar package to VB6. I use it but the IDE is not the greatest. If you know of one let me know..

I have using AutoIt since 2.6x version. It was good and now it is just AWESOME!!!! This tools helps in numerous automation tools. I am thinking of creating a task scheduler interface or to execute AT (task Scheduler) cmdline instructions so that I can manipulate my automated tasks better. Task Scheduler is no very user friendly.

qs, check out this project that Vu1kan has been working on.

http://www.autoitscript.com/forum/index.ph...t=0entry77848

Cheers... :(

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...