+ 11
Need help
Why does the function on line 91-92 (function attack()) doesn’t work? I don’t understand. I think it is something about where the object is pointing to or something. Please help me!!! https://code.sololearn.com/cNlr9ybMx3zA/?ref=app
9 odpowiedzi
+ 4
it appears the problem is in use of superclass weapon
here is a revision of your code that works :
Happy Coding
https://code.sololearn.com/crHRZW07YEkU/?ref=app
+ 11
Mad Max I will answer your bugs:
1. I am a beginner😆😆
2. On SL you can’t do multiple inputs
+ 9
Hamid okay thank you for your help
+ 9
Hamid i have also found a bug by myself in the reset() function. range(len(yours)) must be range(len(yours)-1)
+ 8
Hamid What changes did you make
+ 3
It's a nice game... found few bugs:
1. like your input statement is messed up
2. your game ends after one input... not a very good design...needs to be more interactive...
nothing wrong with the Class structure... overall if you can fix them... it'd be a fun game...
+ 2
if u use super class u can define all methods and class variables there and just define individual variables in subclasses; or like I changed it with no super ;individual classes defined with identically named functions are defined.
Happy Coding
+ 2
it was nothing
by the way I forgot to make my revised code public.😄
Now u can have a look if u like!
Happy Coding
+ 2
yes... got to know lately :p