5 Letter Hangman
#15
Yeah I dumped all the duplicate words and words I didn't recognize, now 440, in a 50 LOC Mouse only Hangman Game.
Code: (Select All)
_Title "b+ 5 Letter Hangman" 'b+ 2022-08-30 work from modified 5 letter word list from Ken
Randomize Timer ' <<< once up here is all that is needed
_FullScreen
DefLng A-Z
w$ = "abuseadultagentangerappleawardbasisbeachbirthblockbloodboardbrainbreadbreakbrownbuyercausechainchairchestchiefchildchinaclaimclassclockcoachcoastcourtcovercreamcrimecrosscrowdcrowncycledancedeathdepthdoubtdraftdramadreamdressdrinkdriveearthenemyentryerroreventfaithfaultfieldfightfinalfloorfocusforceframefrankfrontfruitglassgrantgrassgreengroupguidehearthorsehotelhouseimageindexinputissuejapanjudgeknifelayerlevellightlimitlunchmajormarchmatchmetalmodelmoneymonthmotormouthmusicnightnoisenorthnovelnurseofferorderotherownerpanelpaperpartypeacephasephonepiecepilotpitchplaceplaneplantplatepointpoundpowerpresspriceprideprizeproofqueenradiorangeratioreplyrightriverroundrouterugbyscalescenescopescoresenseshapesharesheepsheetshiftshirtshocksightskillsleepsmilesmithsmokesoundsouthspacespeedspitesportsquadstaffstagestartstatesteamsteelstockstonestorestudystuffstylesugartabletastethemethingtitletotaltouchtowertracktradetraintrendtrialtrusttruthuncleunionunityvaluevideovisitvoicewastewatchwaterwhilewhitewholewomanworldyouththerewherewhichwhoseyoursadmitadoptagreeallowalterapplyargueariseavoidbeginblamebringbuildburstcarrycatchcheckcleanclearclimbclosecountenjoyenterexistguessimplylaughlearnleavemarryoccurproveraisereachreferrelaxserveshallshootsolvespeakspendsplitstandstickteachthankthinkthrowtreatworrywouldwriteaboveacutealivealoneangryawareawfulbasicblackblindbravebriefbroadcheapcivilcrazydailydirtyearlyemptyequalexactextrafaintfalsefifthfirstfreshfunnygiantgrandgreatgrosshappyharshheavyhumanidealinnerjointlargelegallocallooseluckymagicminormoralnakednastynavalouterplainprimepriorproudquickquietrapidreadyroughroyalruralsharpsheershortsillysixthsmallsmartsolidsorrysparesteepstillsupersweetthickthirdtighttoughupperupseturbanusualvaguevalidvitalwrongyoungaftersinceslashuntilaboutaccelafoulagainagapeaheadalikealoftalongaloofaloudamissamplyamuckapaceapartaptlyarearasideaskewbadlybelowcannycoylydimlydittodrylydullyforteforthfullygaylygodlyhencehotlyicilyjollylowlymadlymaybenevernewlynoblyoddlyoftenoughtpianoplumbqueerquitesadlyshylysleekslylystarktallytodaytrulytwiceunderutterwanlywetlyamongcircaminusadieuadiosalohablessbravofudgegollyhavochellohowdymercypsychsalvesniffwackowoops"
While _KeyDown(27) = 0
    word$ = Mid$(w$, 5 * (Int(Rnd * 440)) + 1, 5)
    Show$ = "*****"
    Hanged$ = ""
    L$ = "abcdefghijklmnopqrstuvwxyz"
    missed = 0
    Cls
    Print L$, Show$, Hanged$
    While _KeyDown(27) = 0
        While _MouseInput: Wend
        If _MouseButton(1) Then ' no game until a click
            _Delay .2
            mx = _MouseX
            guess$ = Mid$(L$, mx, 1)
            If guess$ <> " " And guess$ <> "" Then
                Mid$(L$, mx, 1) = " " ' use letter
                hit = 0
                For i = 1 To 5
                    If Mid$(word$, i, 1) = guess$ Then
                        hit = 1
                        Mid$(Show$, i, 1) = guess$
                    End If
                Next
                If hit = 0 Then
                    missed = missed + 1
                    Hanged$ = Mid$("HANGED!", 1, missed)
                End If
            End If
            Cls
            Print L$, Show$, Hanged$
            Print
            If Show$ = word$ Then
                Print "Congrats! you got it!, zzz... "
            ElseIf Hanged$ = "HANGED!" Then
                Print "So sorry you're hanged, the word was "; word$; ", zzz... "
            End If
            If Show$ = word$ Or Hanged$ = "HANGED!" Then
                Sleep
                Exit While
            End If
            _Limit 60
        End If
    Wend
Wend
b = b + ...
Reply


Messages In This Thread
5 Letter Hangman - by SierraKen - 08-29-2022, 06:17 AM
RE: 5 Letter Hangman - by PhilOfPerth - 08-29-2022, 06:46 AM
RE: 5 Letter Hangman - by SierraKen - 08-29-2022, 04:21 PM
RE: 5 Letter Hangman - by bplus - 08-29-2022, 05:27 PM
RE: 5 Letter Hangman - by SierraKen - 08-29-2022, 06:30 PM
RE: 5 Letter Hangman - by SierraKen - 08-29-2022, 06:36 PM
RE: 5 Letter Hangman - by bplus - 08-29-2022, 07:21 PM
RE: 5 Letter Hangman - by SierraKen - 08-29-2022, 09:03 PM
RE: 5 Letter Hangman - by SierraKen - 08-29-2022, 09:08 PM
RE: 5 Letter Hangman - by SierraKen - 08-29-2022, 09:11 PM
RE: 5 Letter Hangman - by SierraKen - 08-29-2022, 09:31 PM
RE: 5 Letter Hangman - by bplus - 08-29-2022, 09:56 PM
RE: 5 Letter Hangman - by SierraKen - 08-29-2022, 10:57 PM
RE: 5 Letter Hangman - by SierraKen - 08-30-2022, 08:23 PM
RE: 5 Letter Hangman - by bplus - 08-30-2022, 09:07 PM
RE: 5 Letter Hangman - by SierraKen - 08-30-2022, 09:28 PM



Users browsing this thread: 7 Guest(s)