A very fun text game that you get to raise a virtual Chao. please give any recommendations.
- Home Page
Pygame.org account Comments
Jouni Järvinen 2011-07-19 07:19:30
Tested "Indev V .75 fixed".
1) The word §global§ is used in classes/functions wanting to edit a globally initialized var' (which is without any indentation), meaning using §global§ with already globally available var's is complete waste.
2) Words like §global§ and §del§ allow to comma-separate var's in one line, like §global fruit, dark, money§.
3) Relating to #3, importing stuff one at a time like §import time; import random§ is unnecessarily wasted effort.
4) your §raw_input§ have no check for wrong info, meaning entering "fuck this" instead of "good" or "neutral" or "evil" will later end the game due to unhandled error. Use the §try§-§except§-§else§ inside a §while§ like http://codepad.org/FHHAx0yw
5) To be compatible with Python 3, the §print§ must use parenthesis like §print("lime green monotone")§
6) Lines like §a=a+2§ are unnecessary extra work for the CPU & the RAM. Instead use §a+=2§. Python supports many alike ways, like §*=§, §-=§, etc. You can find every single such way by typing §help("+=")§, they're called Augmented Assignment Operators.
And more things than listed.
Will it be alright with you if I rewrite the game ?
Jouni Järvinen 2011-07-24 20:28:29
SITUATION UPDATE ON THE REWRITE:
The game is now completely functional (including all your own mistakes I detected) except for loading/saving, racing, having a karate session, checking the credits regarding the authors.
- loading/saving: now that everything is working game-wise, I have to make big modification to the game to support loading/saving.
- racing: previously unfinished feature, now unimplemented cuz[=because] the races were always the same.
- karate: completely unimplemented feature. RATM[=right at the moment] I have no idea what that feature would be like, so I'd appreciate ideas from everyone.
- credits: nobody to credit for works -yet-, you know.
Branson Gustafson 2011-07-31 00:51:51
good but your "randomization" does not work here is the code you need
numDigits = 2 (this line tells how many #s you want I.E. i say 2 it could come out as 23 or 87 or 25. get it?) numbers = list(range(10)) (this is the number it randomizes, I.E. it will start out at 0 '0,1,2,3,4,5,6,7,8,9' FYI this is a list) random.shuffle(numbers) (tells what list to use) global money for i in range(numDigits): (i took this from a freind so i dont know what the "i" does haha:) ) money += str(numbers[i]
iv been programing in python for about a month now so im not good but i hope this helps you :)
Jouni Järvinen 2011-07-31 17:04:54
IF YOU DON'T WANT TO READ POINTS OF IMPROVEMENT, SKIP THIS:
Anyone on my skill will know what you meant, mind you.
- The output of the range() is always a list, therefore specifying to make the output into a list is wasted effort, though without benchmarking I can't tell whether it actually goes through the trouble of making another list.
- Although I'm not completely sure about the §for§'s exact purpose, I won't say it wouldn't do.
- The only line of that loop can possibly have two ideas behind: append into the current money -or- increase the current money. The former doesn't make sense.
FYI the §i§ in that loop has two tasks: for first, the loop itself needs it to stay on track while going through the output of range(): for second, since it's used to stay on track, it can be called during the loop to see which/what item is currently being in turn.