Another error:
you can't use the following code:
print "heaps :", heaps[0], " ", heaps[1], " ", heaps[2]
if you also use this:
del heaps[which2]
You will get an index out of range since you destroy the heap you are reffering to. I would eliminate the delete and find some other way...
You're code is extremely 'unpythonic'. Your making things more difficult than they should be. You almost never need to use 'global' and some of your functions aren't really functions.
One major problem is you have a variable and a function with the same name. Rename your function 'sum' to...
Probably the easiest quick and dirty fix would be to create a function to take a stone and then recursively call itself if the number picked is not allowed.
def take_stones():
#Prompt for how many stones and which stack like you already do
if (make sure they are available)...
Do you know how to create and handle exceptions? They are the proper way to deal with errors like trying to take too many stones.
http://docs.python.org/tut/node10.html - exception handling documentation
Have you learned how to create classes and other object oriented sytle programming...
I have been playing guild wars off and on for a little over a year now. One of the real keys to enjoying the game is joining a good guild (see title of the game). If you get into a nice helpful guild those first couple days of learning are a lot easier. Also Rofl-Mic-Lofl listed probably the...
I ordered the EVGA 7900GT from them at this price a week ago and only finally received tracking status that it will ship today. 11 days to get it with second day shipping. Just a warning to others that think they might recieve their purchases in a reasonable time period. Last time I'm...
Is their a [H] guild for guild wars? I love the game but am to the point where i need a good guild to have fun. The new factions is fun but I think I liked the original better when it came out. I am having fun playing as a ritualist though.