0
I made a love calculator , Now I want to add some function like :
1. One time love calculate , if again try to calculate same names , then it failed Error. 2. If try to other name now it should be work Note : i already add a function love calculate only one times , but if try to other name it will be not working.. I want to a function above said 2 content Here is my code bits : https://code.sololearn.com/Wc5UkWFVMuW4/?ref=app
4 Réponses
+ 3
1. Check that the two names are not blank.
2. Check <darling> != <self>. Can't fall in love to one's self : )
To prevent calculating the same name,
1. Create a var <prevName> outside function `Result`, initialize it with blank string.
2. After reading <darling>, check whether <prevName> == <darling>, if so, cancel calculation.
+ 1
Ipang 2nd thing i dont understand properly,,
Can you edit my code and send me a link
+ 1
The "to prevent calculating the same name" part?
+ 1
Yes,,