Forum: Python Dec 24th, 2008 |
| Replies: 15 Views: 729 Results of the 3 different programs - 1 worked the other two had problems
This one worked fine -
# Character Development Dungeons and Dragons
# pool are the total points that I can use.
class... |
Forum: Python Dec 23rd, 2008 |
| Replies: 15 Views: 729 Ok thanks for your help. Don't want to get you in trouble with the wife. |
Forum: Python Dec 23rd, 2008 |
| Replies: 15 Views: 729 The problem i'm having it's going beyond the 30 pool points?
strength - Enter 10
health - Enter 10
wisdom - Enter 10
dexterity - Enter 10 it shouldn't allow me.
Did it work for you?
For... |
Forum: Python Dec 22nd, 2008 |
| Replies: 15 Views: 729 Ok fixed that integer issue. How do you stop the loop?
pool = 30
strength = 0
health = 0
wisdom = 0
dexterity = 0 |
Forum: Python Dec 22nd, 2008 |
| Replies: 15 Views: 729 Ok I fixed the parenthesis issue. Ran the program got this error msg
NameError: name 'current' is not defined
So later on I added current = 0
Reran the program inserted 10 points for strength... |
Forum: Python Dec 22nd, 2008 |
| Replies: 15 Views: 729 Ran the above code -
I get the error msg - Token Error: EOF in multi-line statement.
# Character Development Dungeons and Dragons
# pool are the total points that I can use.
pool = 30... |
Forum: Python Dec 22nd, 2008 |
| Replies: 15 Views: 729 What else am I missing?
When I ran the program for example enter 10 for strength points it returns back - "That's too much."
pool = 30
strength = 0
health = 0
wisdom = 0
dexterity = 0
choice... |
Forum: Python Dec 19th, 2008 |
| Replies: 15 Views: 729 Character creating program ie Dungeons and Dragons.
Player has 30 points to spend on 4 attributes - strength, health, wisdom, and dexterity.
Player should be able to spend points from the pool on... |
Forum: Python Dec 19th, 2008 |
| Replies: 5 Views: 725 Thanks. It works now with that change.
Just curious if I had left pool = [30] is it impossible to use operands for lists? Such as -, +, *, / if there is a way what is the correct method on doing so? |
Forum: Python Dec 18th, 2008 |
| Replies: 5 Views: 725 How do I subtract or add in a lists?
When I run the program below I get the message
print int(pool-strength)
TypeError: unsupported operand type(s) for -: 'list' and 'int'
# Character... |
Forum: Python Dec 18th, 2008 |
| Replies: 6 Views: 527 |
Forum: Python Dec 16th, 2008 |
| Replies: 6 Views: 527 Thanks for giving me another option to resolve this problem. |
Forum: Python Dec 16th, 2008 |
| Replies: 6 Views: 527 |
Forum: Python Dec 15th, 2008 |
| Replies: 6 Views: 527 Created a program random words with a list.
When I run the program it will output duplicated items. How do I prevent that. Is there a special command to prevent that?
import random
# random... |
Forum: Python Dec 12th, 2008 |
| Replies: 40 Views: 2,635 Thanks for your patience Murtan. Everything works now finally. |
Forum: Python Dec 12th, 2008 |
| Replies: 40 Views: 2,635 Now it works for entering 2 characters, but something else got screwed up. See below
I'm picking one of the 7 words from a secret list
Computer has selected secret word 6 letters.
guess one... |
Forum: Python Dec 12th, 2008 |
| Replies: 40 Views: 2,635 Wish I could use it, but i'm not allowed to use the define function.
It's in the next chapter.
Wish I could life would be much easier. |
Forum: Python Dec 12th, 2008 |
| Replies: 40 Views: 2,635 Here's the complete code, I still have that problem.
I'm picking one of the 7 words from a secret list
Computer has selected secret word 6 letters.
guess one letter er
Please enter only one... |
Forum: Python Dec 11th, 2008 |
| Replies: 40 Views: 2,635 Ok I tried it enter two letters (ie aa) -
Responded back
Please enter one letter
aa
no
guess one letter
How do I prevent it from displaying the input "aa" and not even count this as on of my... |
Forum: Python Dec 11th, 2008 |
| Replies: 40 Views: 2,635 Finally got the darn thing right. Forgot to put in the previous line-
previous += guess under the elif statement.
Now have to figure how to limit my input to one letter. Currently I can enter more... |
Forum: Python Dec 11th, 2008 |
| Replies: 40 Views: 2,635 Ok, fixed that problem by putting in a break statement.
entered correct letter twice and now it won't display the statement
"has already been guessed" it was working darn it.
import random... |
Forum: Python Dec 11th, 2008 |
| Replies: 40 Views: 2,635 Thanks it fixed that problem. Found new issue
if I entered the incorrect word outputs-
incorrect (expected behavior)
Thanks for playing (expected behavior)
Press enter key to exit (expected... |
Forum: Python Dec 10th, 2008 |
| Replies: 40 Views: 2,635 Fixed some of the problems. Still work in progress.
Have to figure out why not getting the correct letter.
[code= python]import random
#list of words the computer will be picking
word_list =... |
Forum: Python Dec 10th, 2008 |
| Replies: 40 Views: 2,635 Thanks missed that darn parenthesis.
Ran the complete program enter the letter a twice.
It should have displayed "has already been guessed"
Is it because guess has no define value?
If so I set... |
Forum: Python Dec 9th, 2008 |
| Replies: 40 Views: 2,635 I'm currently using this python idle and it doesn't give me this precise error. So I ran it under the command prompt and I got line 20
print guess, "has already been guessed"
System error invalid... |
Forum: Python Dec 9th, 2008 |
| Replies: 40 Views: 2,635 Ok got that resolved. Program still not complete verifying the letter input process works unfortunately when I run it it's complaining
Error: Inconsistent indentation detected!
This means that... |
Forum: Python Dec 8th, 2008 |
| Replies: 40 Views: 2,635 Ok here's a partial list program not complete. Doing it in small portions - Does this one make more sense.
import random
# list of words
word_list = ['python', 'jumble', 'easy', 'difficult',... |
Forum: Python Dec 8th, 2008 |
| Replies: 40 Views: 2,635 Ok did both of those items. Replaced random_word with word.
I entered 5 guesses all were incorrect. Something has gone awry I can't any correct letters.
Took out guess_word.strip and replaced... |
Forum: Python Dec 8th, 2008 |
| Replies: 40 Views: 2,635 Thanks it got rid of that error message reran the program now it's complaining about the 2nd break statement - That's an invalid statement. So I took it out later to see what will happened.... |
Forum: Python Dec 7th, 2008 |
| Replies: 40 Views: 2,635 Tinkered with code using previous advice got this error message
'return' outside function line 35.
What does that mean?
Checked line 35
elif guess_word.lower() == random_word:
line 34 which has... |
Forum: Python Dec 4th, 2008 |
| Replies: 40 Views: 2,635 Am I interpreting this correctly -
So using the example for the program above
my_tup = () - would be tried_good = ()
my_tup2=() - would be tried_bad = ()
for i in range in xrange (5): meaning I... |
Forum: Python Dec 2nd, 2008 |
| Replies: 40 Views: 2,635 Unfortunately the list feature is in the next chapter. Suppose to just use loops, strings and tuples. |
Forum: Python Dec 1st, 2008 |
| Replies: 40 Views: 2,635 Darn it I now get this error message -
line 17, in -toplevel-
guess +=tried_bad
TypeError: cannot concatenate 'str' and 'tuple' objects
# Guess My Word
# Players pick letters in a random... |
Forum: Python Nov 28th, 2008 |
| Replies: 40 Views: 2,635 How do I modify this program player has 5 chances to ask a letter is in the word. Computer responds yes and no.
Original Exercise - Computer picks a random word from a list and player guesses the... |
Forum: Python Nov 27th, 2008 |
| Replies: 17 Views: 1,820 Ran the program computer outputs 10 random words. But what I want is the computer to pick a random word and the user has to guess it. Computer tells the player how many letters are in the word. The... |
Forum: Python Nov 27th, 2008 |
| Replies: 17 Views: 1,820 Here's the link of that file it's zipped up someone sent to me.
http://www.daniweb.com/forums/post160495-8.html |
Forum: Python Nov 27th, 2008 |
| Replies: 17 Views: 1,820 Ok, I put those lines in the beginning of the program. Still got the same result. |
Forum: Python Nov 27th, 2008 |
| Replies: 17 Views: 1,820 Thanks error message went away.
Could you recommend which Python editor to use?
Also when I ran the program no error message, but nothing happens.
What am I missing now? |
Forum: Python Nov 27th, 2008 |
| Replies: 17 Views: 1,820 So what is wrong with this code especially line 14 -
There's an error in your program *** 'return' outside function (random_word.py , line 14.)
from os.path import getsize
from random import... |
Forum: Python Nov 26th, 2008 |
| Replies: 17 Views: 1,820 Ran the above program I get the following error message "There's an error in your program ** ' return outside function (random_word.py, line 13.)
Line 13 - return L [1 ]
What does that message... |