I made a love calculator , Now I want to add some function like : | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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

10th Jan 2021, 3:18 PM
Sajid Ali
Sajid Ali - avatar
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.
10th Jan 2021, 3:39 PM
Ipang
+ 1
Ipang 2nd thing i dont understand properly,, Can you edit my code and send me a link
10th Jan 2021, 3:55 PM
Sajid Ali
Sajid Ali - avatar
+ 1
The "to prevent calculating the same name" part?
10th Jan 2021, 3:57 PM
Ipang
+ 1
Yes,,
10th Jan 2021, 3:58 PM
Sajid Ali
Sajid Ali - avatar