USING DARKBASIC PROFESSIONAL
@TDK, I found a crude hangman do...loop that you posted somewhere around here and I saw an opportunity to try out arrays. I was wondering if you can help me out with this; tell me if I'm going in the right direction or not. Also, I found that, in it's original form (with Alphabet$=
the alphabet) after the 11th letter that you guess, the program will no longer print the rest of the Alphabet$.
What I want the program to do is let you choose a category (1=insets,2=names,3=colors) and it will randomly select one of the 5 words in the category that you choose. You will be allowed 8 incorrect answers until the word is revealed and the game is over.
REMSTART
-------- Title: Hangman
-------- Author: xxxxx xxxxxx
-------- Date: October 7/2005
REMEND
DIM Category$(3,5)
`declare Insect category
Category$(1,1)="Butterfly"
Category$(1,2)="Roach"
Category$(1,3)="Grasshopper"
Category$(1,4)="Centipede"
Category$(1,5)="Dragonfly"
`declare Name category
Category$(2,1)="Nigel"
Category$(2,2)="Lawrence"
Category$(2,3)="Sabrina"
Category$(2,4)="Nadine"
Category$(2,5)="Natalie"
`declare Color category
Category$(3,1)="Indigo"
Category$(3,2)="Violet"
Category$(3,3)="Beige"
Category$(3,4)="Yellow"
Category$(3,5)="Orange"
`not sure why I declares these next two things, but I think I need to
`this is for the categories
for c=1 to 3
`this is for the word
for w=1 to 5
CLS 0
Do
Input "Enter A Letter: ";Guess$
Guess$ = Upper$(Guess$)
NotUsed = 0
For N=1 To Len(Category$)
If Mid$(Category$,N) = Guess$
Alphabet$ = Left$(Category$,N-1)+Right$(Category$,Len(Category$)-N)
`Print "Category$: ";Category$
`Print
NotUsed = 1
Exit
Endif
Next N
If NotUsed = 0
Print "Already Tried That Letter!"
Print
Endif
Loop