Calculations in python -
I find it difficult to calculate a portion of my program in Python.
This is the code for any reason. I record strength and skill for both characters which prints the program and what I have entered is actually counting new strengths and skills. Which uses str and skl mod and dif.
There are so many things, and I'm not sure that you understand what your argument is really In this case, regardless of the strength or skill of any player, the winner of the goal is determined by a random number. Also, please refer to other and alif statements for conditionals. Import the random import math CharacterOne = Input ("Enter the name of the first player:") Letter = 2 input ("Enter second player name:") ch1str = int (input (characters) The power of "+":)) ch1skl = int (input is a skill of "in": ")) ch2str = int (input is the strength of two:")) ch2skl = int (input ( Character + Two +) is the skill: ")) # You do not have to insert the int here, your wars are already ints. In addition, you can use full value to avoid additional conditional. Strdif = stomach (ch1str-ch2str) strmod = strdif / 5 skldif = stomach (ch1skl-ch2skl) sklmod = skldif // 5 number1 = random.randrange (1,6) if number 1 & gt; = 3: ch1str + = strmod ch1skl + = sklmod ch2str- = strmod ch2skl- = sklmod play1 = a and it's true: ch2str + = strmod ch2skl + = sklmod ch1str- = strmod ch1skl- = sklmod play1 = false #no idea What are you doing here Do we care that their statistics are negative? Why not just & lt; Compare 0? #if ch1skl & lt; 0: # ch1skl = 0 #if ch2skl & lt; 0: # ch2skl = 0 #if ch1str & lt; 0: # ch1str = 0 #if ch2str & lt; 0: # ch2str = 0 If ch1str & lt; 0: print (CharacterOne + is "dead now") if ch2str & lt; 0: print (CharacterTwo + "is dead now") # Do you want the winner to be randomly determined? Currently there is no effect on the winner of your statistics if play1 == true: print (Characteron + "won this round, is now", "1", "power" and ", ch1skl," skill ") print (character) Two + "has lost this round, is now", "power" and ", ch2str," skill ") other: print (Characters" four + won in this round, now ", ch2str," power and ", Ch2skl, "skill") print (characteron + "has lost this round, is now", ch1str, "power and", ch1skl, "skill")
Comments
Post a Comment