Making a hangman code (I'm a n00b, still in the tutorial stage)
Anyway, here's my (top-secret) code: - def guess():
-
choice=raw_input("Guess!(lowercase only please!)")
-
if len(choice)>1:
-
print "Don't cheat!"
-
guess()
-
elif guess in y:
-
b[z.find(choice)]=choice
-
print "Good Choice!"
-
print ''.join(b)
-
guess()
-
-
def main():
-
x=raw_input("Type a name")
-
y=x.lower().split(' ')
-
z=''.join(y)
-
print z
-
b=['_ ']*len(z)
-
print ''.join(b)
-
guess()
-
-
if __name__=='__main__':
-
main()
-
Anyways, I get down to line 6 and it tells me that global name z is not defined. I'm guessing I have to put the z thing in there, but I don't know how.
What should I do?
P.S. the code is still in development. That is why it is not finished.
24 15911
Making a hangman code (I'm a n00b, still in the tutorial stage)
Anyway, here's my (top-secret) code: - def guess():
-
choice=raw_input("Guess!(lowercase only please!)")
-
if len(choice)>1:
-
print "Don't cheat!"
-
guess()
-
elif guess in y:
-
b[z.find(choice)]=choice
-
print "Good Choice!"
-
print ''.join(b)
-
guess()
-
-
def main():
-
x=raw_input("Type a name")
-
y=x.lower().split(' ')
-
z=''.join(y)
-
print z
-
b=['_ ']*len(z)
-
print ''.join(b)
-
guess()
-
-
if __name__=='__main__':
-
main()
-
Anyways, I get down to line 6 and it tells me that global name z is not defined. I'm guessing I have to put the z thing in there, but I don't know how.
What should I do?
P.S. the code is still in development. That is why it is not finished.
Hi St33med. Most code we see here is "still in development"; we're here to help you get it working. So, welcome to the Python help forum on TSDN!
This is an issue of "scope". The scope rules say that variables assigned in a function are "local" to that function. I quick way to make this work is (but maybe not the best): - def guess():
-
choice=raw_input("Guess!(lowercase only please!)")
-
if len(choice)>1:
-
print "Don't cheat!"
-
guess()
-
elif guess in y:
-
b[z.find(choice)]=choice
-
print "Good Choice!"
-
print ''.join(b)
-
guess()
-
-
if __name__=='__main__':
-
x=raw_input("Type a name")
-
y=x.lower().split(' ')
-
z=''.join(y)
-
print z
-
b=['_ ']*len(z)
-
print ''.join(b)
-
guess()
-
-
I'm in a rush at this second, but I'll have some time in just a bit...
Thanks for joining.
Hi St33med. Most code we see here is "still in development"; we're here to help you get it working. So, welcome to the Python help forum on TSDN!
This is an issue of "scope". The scope rules say that variables assigned in a function are "local" to that function. I quick way to make this work is (but maybe not the best): - def guess():
-
choice=raw_input("Guess!(lowercase only please!)")
-
if len(choice)>1:
-
print "Don't cheat!"
-
guess()
-
elif guess in y:
-
b[z.find(choice)]=choice
-
print "Good Choice!"
-
print ''.join(b)
-
guess()
-
-
if __name__=='__main__':
-
x=raw_input("Type a name")
-
y=x.lower().split(' ')
-
z=''.join(y)
-
print z
-
b=['_ ']*len(z)
-
print ''.join(b)
-
guess()
-
-
I'm in a rush at this second, but I'll have some time in just a bit...
Thanks for joining.
What this does is put the varaibles x, y and z into the module scope. As such, they can be "seen" by functions that are also in that scope. This use of "global" scope variables is good for learning because it is fairly simple. There are lot's of other things to change before we get to the final working program, but let's take it one step at a time. And HAVE FUN.
Well, the code worked and I made some enhancements: - def guess():
-
choice=raw_input("Guess!(lowercase only please!)")
-
a=type.find(str(choice))
-
if len(choice)>1:
-
print "Don't cheat!"
-
guess()
-
elif a!=-1:
-
b[a]=str(choice)
-
print "Good Choice!"
-
c=''.join(b)
-
print c
-
if type==c:
-
print "You Win!"
-
else:
-
guess()
-
else:
-
d+=1
-
e[d]=choice
-
if d==0:
-
print "O",e
-
guess()
-
elif d==1:
-
print e,"O<"
-
guess()
-
elif d==2:
-
print e,"0<-"
-
guess()
-
elif d==3:
-
print e,"O<-<\n Game Over"
-
-
if __name__=='__main__':
-
type=raw_input("Type a name:")
-
type=''.join(type.lower().split(' '))
-
#print type
-
b=['_ ']*len(type)
-
print ''.join(b)
-
d=-1
-
e=['']*5
-
guess()
The problem with this code is that it tells me that d was referenced before assignment. If I put d in def guess, then it will always return d to -1 and the guy taking guesses will have infinite amount of guesses. That might have been why you said that the solution was not the best. What should I do?
Well, the code worked and I made some enhancements: - def guess():
-
choice=raw_input("Guess!(lowercase only please!)")
-
a=type.find(str(choice))
-
if len(choice)>1:
-
print "Don't cheat!"
-
guess()
-
elif a!=-1:
-
b[a]=str(choice)
-
print "Good Choice!"
-
c=''.join(b)
-
print c
-
if type==c:
-
print "You Win!"
-
else:
-
guess()
-
else:
-
d+=1
-
e[d]=choice
-
if d==0:
-
print "O",e
-
guess()
-
elif d==1:
-
print e,"O<"
-
guess()
-
elif d==2:
-
print e,"0<-"
-
guess()
-
elif d==3:
-
print e,"O<-<\n Game Over"
-
-
if __name__=='__main__':
-
type=raw_input("Type a name:")
-
type=''.join(type.lower().split(' '))
-
#print type
-
b=['_ ']*len(type)
-
print ''.join(b)
-
d=-1
-
e=['']*5
-
guess()
The problem with this code is that it tells me that d was referenced before assignment. If I put d in def guess, then it will always return d to -1 and the guy taking guesses will have infinite amount of guesses. That might have been why you said that the solution was not the best. What should I do?
in your guess() function, 'd' is never 'initialized' before you do d+=1.
Either you pass 'd' value into guess(), as in guess(d) , or use global.
What my friend ghostdog74 means is: - def guess():
-
global d
-
choice=raw_input("Guess!(lowercase only please!)")
-
a=type.find(str(choice))
-
if len(choice)>1:
-
print "Don't cheat!"
-
guess()
-
elif a!=-1:
-
b[a]=str(choice)
-
print "Good Choice!"
-
c=''.join(b)
-
print c
-
if type==c:
-
print "You Win!"
-
else:
-
guess()
-
else:
-
d+=1
-
e[d]=choice
-
if d==0:
-
print "O",e
-
guess()
-
elif d==1:
-
print e,"O<"
-
guess()
-
elif d==2:
-
print e,"0<-"
-
guess()
-
elif d==3:
-
print e,"O<-<\n Game Over"
-
-
if __name__=='__main__':
-
type=raw_input("Type a name:")
-
type=''.join(type.lower().split(' '))
-
#print type
-
b=['_ ']*len(type)
-
print ''.join(b)
-
d=-1
-
e=['']*5
-
guess()
-
It's very cute! I ran it and it work using this global scope technique. You a really quit a good pythoneer. Keep it up! Next you may want to play with parameter passing (also as GD has suggested).
Just an opinion of mine, its better to use while loop for tasks like this:
for example: -
while 1:
-
ask for input
-
if input is quit or exit:
-
break
-
else:
-
call your functions.
-
In the original code, guess() is defined as a function, but in it, there are also calls to guess() itself. In programming concepts, this is something like recursion. Before the first call to guess() has returned to caller, another guess() gets called and so on. The stack gets slowly "filled up" due to storing of return addresses and etc etc......at least that's how i feel.
bvdet 2,851
Expert Mod 2GB
What my friend ghostdog74 means is: - def guess():
-
global d
-
choice=raw_input("Guess!(lowercase only please!)")
-
a=type.find(str(choice))
-
if len(choice)>1:
-
print "Don't cheat!"
-
guess()
-
elif a!=-1:
-
b[a]=str(choice)
-
print "Good Choice!"
-
c=''.join(b)
-
print c
-
if type==c:
-
print "You Win!"
-
else:
-
guess()
-
else:
-
d+=1
-
e[d]=choice
-
if d==0:
-
print "O",e
-
guess()
-
elif d==1:
-
print e,"O<"
-
guess()
-
elif d==2:
-
print e,"0<-"
-
guess()
-
elif d==3:
-
print e,"O<-<\n Game Over"
-
-
if __name__=='__main__':
-
type=raw_input("Type a name:")
-
type=''.join(type.lower().split(' '))
-
#print type
-
b=['_ ']*len(type)
-
print ''.join(b)
-
d=-1
-
e=['']*5
-
guess()
-
It's very cute! I ran it and it work using this global scope technique. You a really quit a good pythoneer. Keep it up! Next you may want to play with parameter passing (also as GD has suggested).
It does work well. However, if you enter a word that has two of the same letter as in "sell", you can never solve it. You should not use a variable name that masks a Python built-in function (type). We had another thread on Hangman recently, and we used this function to determine the occurances of a letter in a word: - def indexList(s, item, i=0):
-
i_list = []
-
while True:
-
try:
-
i = s.index(item, i)
-
i_list.append(i)
-
i += 1
-
except:
-
break
-
return i_list
I agree with ghostdog74 abot the use of a loop instead of recursion. I also encourage you to avoid using global variables where possible. As in the function listed above, the word (s) and letter (item) are passed to get_index() and in return we receive a list of indices or an empty list if there were no occurances of 'item' in 's': - >>> iLst = indexList('mississippi', 's')
-
>>> iLst
-
[2, 3, 5, 6]
-
>>> hint_string = '_'*len('mississippi')
-
>>> for i in iLst:
-
... lst = [hint_string[:i], ]
-
... if len(hint_string) >= i+1:
-
... lst.append(hint_string[(i+1):])
-
... hint_string = 's'.join(lst)
-
...
-
>>> hint_string
-
'__ss_ss____'
-
>>>
Well here is my code, almost finished: - import sys
-
def guess(d,x,e):
-
choice=raw_input("Guess!(lowercase only please!)")
-
a=type.find(str(choice))
-
if len(choice)>1:
-
print "Don't cheat!"
-
guess(d,x,e)
-
elif a!=-1:
-
b[a]=str(choice)
-
print "Good Choice!"
-
c=''.join(b)
-
print c, e
-
if type==c:
-
print "You Win!"
-
sys.exit()
-
else:
-
guess(d,x,e)
-
else:
-
d+=x
-
if guess in e:
-
print "You have already guessed this!"
-
guess(d,x,e)
-
e[d]=choice
-
if d==0:
-
print "O"
-
x=1
-
elif d==1:
-
print "O<"
-
x=2
-
elif d==2:
-
print "0<-"
-
x=3
-
elif d==3:
-
print "O<-<\n Game Over"
-
sys.exit()
-
print "Letters Guessed: ", ' '.join(e)
-
guess(d,x,e)
-
if __name__=='__main__':
-
type=raw_input("Type a name:")
-
type=''.join(type.lower().split(' '))
-
#print type
-
b=['_ ']*len(type)
-
print ''.join(b)
-
d=0
-
x=0
-
e=['']*4
-
guess(d,x,e)
-
-
Where should I put this indexList?
bvdet 2,851
Expert Mod 2GB
Well here is my code, almost finished: - import sys
-
def guess(d,x,e):
-
choice=raw_input("Guess!(lowercase only please!)")
-
a=type.find(str(choice))
-
if len(choice)>1:
-
print "Don't cheat!"
-
guess(d,x,e)
-
elif a!=-1:
-
b[a]=str(choice)
-
print "Good Choice!"
-
c=''.join(b)
-
print c, e
-
if type==c:
-
print "You Win!"
-
sys.exit()
-
else:
-
guess(d,x,e)
-
else:
-
d+=x
-
if guess in e:
-
print "You have already guessed this!"
-
guess(d,x,e)
-
e[d]=choice
-
if d==0:
-
print "O"
-
x=1
-
elif d==1:
-
print "O<"
-
x=2
-
elif d==2:
-
print "0<-"
-
x=3
-
elif d==3:
-
print "O<-<\n Game Over"
-
sys.exit()
-
print "Letters Guessed: ", ' '.join(e)
-
guess(d,x,e)
-
if __name__=='__main__':
-
type=raw_input("Type a name:")
-
type=''.join(type.lower().split(' '))
-
#print type
-
b=['_ ']*len(type)
-
print ''.join(b)
-
d=0
-
x=0
-
e=['']*4
-
guess(d,x,e)
-
-
Where should I put this indexList?
Anywhere above "if __name__ == '__main__':"
Anywhere above "if __name__ == '__main__':"
And then put the indexList in what part of the code?
bvdet 2,851
Expert Mod 2GB
And then put the indexList in what part of the code?
You will need to rework your code somewhat, because you have a list of indices instead of a single index. Here's a start: -
def guess(d,x,e):
-
choice = raw_input("Guess!(lowercase only please!)")
-
aList = indexList(word, choice)
-
...........................
-
elif len(aList) > 0:
-
print 'There are %d occurrances of %s in %s' % (len(aList), choice, word)
Notice that I am using 'word' instead of 'type'.
Need an explanation of what indexList does. I'm just having a hard time following what it does.
Never mind about last. The problem is when I put aList as the element in b (as in b[aList]=str(choice)) , it tells me that aList needs to be an integer, not a list. How do I transform aList into an integer?
Need an explanation of what indexList does. I'm just having a hard time following what it does.
- def indexList(s, item, i=0):
-
i_list = []
-
while True:
-
try:
-
i = s.index(item, i)
-
i_list.append(i)
-
i += 1
-
except:
-
break
-
return i_list
returns a list of inexes for every occurance of item in s.
Never mind about last. The problem is when I put aList as the element in b (as in b[aList]=str(choice)) , it tells me that aList needs to be an integer, not a list. How do I transform aList into an integer?
I'm having a hard time following along because your variable names are not very descriptive. If b (could use a better name) is a list, why not somethingbetterList?
If aList is a list of indexes, you need to - b[aList][indexintothislist] = str(choice)
Alright here is the more understandable code: - import sys # used to exit
-
def guess(count,addCount,letters):
-
choice=raw_input("Guess!(lowercase only please!)")
-
aList=indexList(word, choice)
-
print aList
-
if len(choice)>1:
-
print "Don't cheat!" # Exactly :)
-
guess(count,addCount,letters)
-
elif aList!=[-1]:
-
line[aList]=str(choice) #Problem here. aList is list when needs to be integers
-
print "Good Choice!"
-
c=''.join(line)
-
print c,"Letters missed:", letters #Tells what letters the guy has missed
-
if word==c:
-
print "You Win!"
-
sys.exit()
-
else:
-
guess(count,addCount,letters) #repeats until win or lose
-
else:
-
if choice in letters:
-
print "You have already guessed this!" #so he/she doesn't repeat a stupid mistake
-
guess(count,addCount,letters)
-
count+=addCount
-
letters[count]=choice
-
if count==0:
-
print "O"
-
addCount=1
-
elif count==1:
-
print "O<"
-
addCount=2
-
elif count==2:
-
print "0<-"
-
addCount=3
-
elif count==3:
-
print "O<-<\n Game Over XP"
-
sys.exit()
-
print "Letters missed: ", ' '.join(letters)
-
guess(count,addCount,letters)
-
-
def indexList(s, item, i=0):
-
i_list = []
-
while True:
-
try:
-
i = s.index(item, i)
-
i_list.append(i)
-
i += 1
-
except:
-
i_list.append(-1)
-
break
-
return i_list
-
-
if __name__=='__main__':
-
word=raw_input("Type a name:")
-
word=''.join(word.lower().split(' '))
-
#print word #This was just for testing
-
line=['_ ']*len(word)
-
print ''.join(line)
-
count=0 #set count
-
addCount=0 #set add count
-
letters=['']*4 #make an empty list
-
guess(count,addCount,letters)
-
-
As it says in line 10, I need to find out how to make aList an integer because line will not recognize the elements inside a list.
Hmmmmm.....
Whoops! What I meant to say was what do you put inside the second [], bartonc?
Alright here is the more understandable code: - import sys # used to exit
-
def guess(count,addCount,letters):
-
choice=raw_input("Guess!(lowercase only please!)")
-
aList=indexList(word, choice)
-
print aList
-
if len(choice)>1:
-
print "Don't cheat!" # Exactly :)
-
guess(count,addCount,letters)
-
elif aList!=[-1]:
-
line[aList]=str(choice) #Problem here. aList is list when needs to be integers
-
print "Good Choice!"
-
c=''.join(line)
-
print c,"Letters missed:", letters #Tells what letters the guy has missed
-
if word==c:
-
print "You Win!"
-
sys.exit()
-
else:
-
guess(count,addCount,letters) #repeats until win or lose
-
else:
-
if choice in letters:
-
print "You have already guessed this!" #so he/she doesn't repeat a stupid mistake
-
guess(count,addCount,letters)
-
count+=addCount
-
letters[count]=choice
-
if count==0:
-
print "O"
-
addCount=1
-
elif count==1:
-
print "O<"
-
addCount=2
-
elif count==2:
-
print "0<-"
-
addCount=3
-
elif count==3:
-
print "O<-<\n Game Over XP"
-
sys.exit()
-
print "Letters missed: ", ' '.join(letters)
-
guess(count,addCount,letters)
-
-
def indexList(s, item, i=0):
-
i_list = []
-
while True:
-
try:
-
i = s.index(item, i)
-
i_list.append(i)
-
i += 1
-
except:
-
i_list.append(-1)
-
break
-
return i_list
-
-
if __name__=='__main__':
-
word=raw_input("Type a name:")
-
word=''.join(word.lower().split(' '))
-
#print word #This was just for testing
-
line=['_ ']*len(word)
-
print ''.join(line)
-
count=0 #set count
-
addCount=0 #set add count
-
letters=['']*4 #make an empty list
-
guess(count,addCount,letters)
-
-
As it says in line 10, I need to find out how to make aList an integer because line will not recognize the elements inside a list.
Hmmmmm.....
I'm guessing that you want something like -
line[aList][count]=str(choice) # index into a list of indexes
Whoops! What I meant to say was what do you put inside the second [], bartonc?
Hah, you beat me to it (by a few seconds).
Weird. [count] obviously does nothing for it still gives me a TypeError.
Specifically, the TypeError looks like this: - TypeError: list indices must be integers
I might have read this wrong.
bvdet 2,851
Expert Mod 2GB
Weird. [count] obviously does nothing for it still gives me a TypeError.
Specifically, the TypeError looks like this: - TypeError: list indices must be integers
I might have read this wrong.
- elif len(aList) > 0:
-
for i in aList:
-
line[i] = choice # is not choice already a string?
-
..............................................................................
- elif len(aList) > 0:
-
for i in aList:
-
line[i] = choice # is not choice already a string?
-
..............................................................................
Yea! That worked! Before, I had to put choice as a string for some reason. It returned some type of error. But when I put in your code without the str before choice, it worked. Huh. I might've been seeing things.
Anyway, thank you for helping me! And, for those of you who want to see the final code, here it is: - import sys # used to exit
-
def guess(count,addCount,letters):
-
choice=raw_input("Guess!(lowercase only please!)")
-
aList=indexList(word, choice)
-
print aList
-
if len(choice)>1:
-
print "Don't cheat!" # Exactly :)
-
guess(count,addCount,letters)
-
elif len(aList) > 0:
-
for i in aList:
-
line[i] = choice #Problem here. aList is list when needs to be integers
-
print "Good Choice!"
-
c=''.join(line)
-
print c,"Letters missed:", letters #Tells what letters the guy has missed
-
if word==c:
-
print "You Win!"
-
sys.exit()
-
else:
-
guess(count,addCount,letters) #repeats until win or lose
-
else:
-
if choice in letters:
-
print "You have already guessed this!" #so he/she doesn't repeat a stupid mistake
-
guess(count,addCount,letters)
-
count+=addCount
-
letters[count]=choice
-
if count==0:
-
print "O"
-
addCount=1
-
elif count==1:
-
print "O<"
-
addCount=2
-
elif count==2:
-
print "0<-"
-
addCount=3
-
elif count==3:
-
print "O<-<\n Game Over XP"
-
sys.exit()
-
print "Letters missed: ", ' '.join(letters)
-
guess(count,addCount,letters)
-
-
def indexList(s, item, i=0):
-
i_list = []
-
while True:
-
try:
-
i = s.index(item, i)
-
i_list.append(i)
-
i += 1
-
except:
-
break
-
return i_list
-
-
if __name__=='__main__':
-
word=raw_input("Type a name:")
-
word=''.join(word.lower().split(' '))
-
#print word #This was just for testing
-
line=['_ ']*len(word)
-
print ''.join(line)
-
count=0 #set count
-
addCount=0 #set add count
-
letters=['']*4 #make an empty list
-
guess(count,addCount,letters) #carries everything to guess for later use
-
bvdet 2,851
Expert Mod 2GB
Yea! That worked! Before, I had to put choice as a string for some reason. It returned some type of error. But when I put in your code without the str before choice, it worked. Huh. I might've been seeing things.
Anyway, thank you for helping me! And, for those of you who want to see the final code, here it is: - import sys # used to exit
-
def guess(count,addCount,letters):
-
choice=raw_input("Guess!(lowercase only please!)")
-
aList=indexList(word, choice)
-
print aList
-
if len(choice)>1:
-
print "Don't cheat!" # Exactly :)
-
guess(count,addCount,letters)
-
elif len(aList) > 0:
-
for i in aList:
-
line[i] = choice #Problem here. aList is list when needs to be integers
-
print "Good Choice!"
-
c=''.join(line)
-
print c,"Letters missed:", letters #Tells what letters the guy has missed
-
if word==c:
-
print "You Win!"
-
sys.exit()
-
else:
-
guess(count,addCount,letters) #repeats until win or lose
-
else:
-
if choice in letters:
-
print "You have already guessed this!" #so he/she doesn't repeat a stupid mistake
-
guess(count,addCount,letters)
-
count+=addCount
-
letters[count]=choice
-
if count==0:
-
print "O"
-
addCount=1
-
elif count==1:
-
print "O<"
-
addCount=2
-
elif count==2:
-
print "0<-"
-
addCount=3
-
elif count==3:
-
print "O<-<\n Game Over XP"
-
sys.exit()
-
print "Letters missed: ", ' '.join(letters)
-
guess(count,addCount,letters)
-
-
def indexList(s, item, i=0):
-
i_list = []
-
while True:
-
try:
-
i = s.index(item, i)
-
i_list.append(i)
-
i += 1
-
except:
-
break
-
return i_list
-
-
if __name__=='__main__':
-
word=raw_input("Type a name:")
-
word=''.join(word.lower().split(' '))
-
#print word #This was just for testing
-
line=['_ ']*len(word)
-
print ''.join(line)
-
count=0 #set count
-
addCount=0 #set add count
-
letters=['']*4 #make an empty list
-
guess(count,addCount,letters) #carries everything to guess for later use
-
You have an incorrect indentation at a critical point which prevents the script from executing properly. Try 'mississippi'. Once you make this correction, you are looking good!
Whoops! I indented everything after the for statement, making it run only once. Fixed that and it now runs like a charm!
Again, Thanks!
EDIT: You beat me to it. Darn! :D
Sign in to post your reply or Sign up for a free account.
Similar topics
by: tigrfire |
last post by:
So I'm trying to write a hangman game and the output is coming out a
little strange. Here's my code thus far:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
...
|
by: ilikepython |
last post by:
Hi I'm new to Python(3 to 4 days) and I'm working on a hangman game and have been having some problems that really annoy me.
Here is part of my script:
c = input('Would you like to play hangman?...
|
by: princessfrost |
last post by:
Hi! I was wondering if someone could please help me with a hangman program that I have to do. I have some ideas, but really don't know what to do or where to start. My program needs to be:...
|
by: araujo2nd |
last post by:
Originally Posted by araujo2nd
my name is andre, im from south africa, i was wondering if any1 could help me with a hangman application, im now in grade 11 and have a huge portfolio piece to do by...
|
by: kaka_hunter |
last post by:
#include <iostream>
#include <fstream>
using namespace std;
const int max_tries=7;
int earnings=0;
int wordnum;
void getword ()
{
ifstream fin;
|
by: tesa |
last post by:
I am not able to figure out how to make this work.
I am trying to create a hangman game. I am in a basic javascripting class.
I am to only use very basic code as you can see. I am able to use any...
|
by: Madmartigan |
last post by:
Hi
I'm a newbie to C# and have been instructed to create a Hangman game in SharpDevelop. I don't want the answer to the full code, just some help along the way.
I have included my code thus...
|
by: tidiz |
last post by:
Hi,
I'm trying to make a hangman game that should look like this:
Welcome to Hangman
______
Your guess: c
Success!
__cc__
Your guess: b
|
by: AlexSc |
last post by:
Hi to All,
I am doing on a hangman project, Where this is a very simple one, where player would guess the word and if it is correct the letter would be from "-" to the correct letter once all...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |