Created with <3 with dartpad.dev.
Created
June 19, 2023 17:11
-
-
Save onumanfj/4a5fff8bc1a8cdaabfce9b79d4281196 to your computer and use it in GitHub Desktop.
dart - conditions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
void main() { | |
loveCalculator(); | |
} | |
void loveCalculator() { | |
int loveNumber = Random().nextInt(100) + 1; | |
print(loveNumber); | |
if (loveNumber > 70) { | |
print('You are in love'); | |
} else if (loveNumber < 70 && loveNumber > 30) { | |
print('You like each other'); | |
} else { | |
print('You don\'t like each other'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment