+ 1
My game needs testing
My game is *currently* in a testing phase and I need people to play it and test it out for me if you do and spot a bug or misspell then please tell me below! here is the link... https://code.sololearn.com/cSTmHvmkk1R7/#py if you think it is good I would appreciate and upvote... EDIT: Thanks for all the help my game will exit testing phase soon...
3 Answers
+ 2
Great and fun code!
I tested it to a different IDE (for multiple inputs) and here are my suggestions based on my experience.
1) When I run the program, I had no idea what to input as there is no printed text in the terminal. So instead of placing those as a comment, print those texts to guide the player what kind of input is needed. Although in sololearn, it's better to leave those as a comment so it will only print the final output.
2) When taking numeral inputs, use int() function to convert the input into an integer
š¹ int(input())
This way, you could compare integers to integers
š¹ if Mercy > 7:
which is more reliable than comparing numeral string to numeral string
šø if Mercy > "7":
This only compares the order of the character of "7" and not the integer value of it.
3) Added "- " inside input() to indicate a clearer input space for the player. For example:
Horde or Alliance?
- Horde
Here is your code (with some changes based on suggestions above)
https://code.sololearn.com/cblfSP3uikdn/?ref=app
+ 2
4) Additional suggestions on taking and validating user inputs:
Let's say on some cases, the user inputs "horde" instead of "Horde".
Horde or Alliance?
- horde
This will not raise an error but there could be some problems on the game logic and conditions as "Horde" is different from "horde".
So even if the input is "horde", the condition `if Side == "Horde"` is False.
There is a string method called str.capitalize().
š¹ print("horde".capitalize())
>> Horde
š¹ print("hoRdE.capitalize())
>> Horde
This ensures that any case (lowercase, uppercase) of "horde" will result into "Horde".
5) There is a possibility that the player inputs some invalid value or made some spelling and minor mistakes.
For example, the player inputs 12 in Mercy wherein only 1 to 10 are the values allowed.
That is why input validation is important, where the program will take user input until the values are valid.
Here's an example of input checking/validation using while loop.
https://code.sololearn.com/cHDsjrRq4KRa/?ref=app
+ 1
Thanks for the help!
I tested it and the if Mercy > "5": still works so I am gonna keep it!
I was also editing it and noticed some bad errors so I fixed them!
Now all I need is a name for it...