Skip to content

Instantly share code, notes, and snippets.

@it-one-mm
Created April 25, 2020 18:20
Show Gist options
  • Save it-one-mm/fb7f01fd57d8f3efcc624287e51e2672 to your computer and use it in GitHub Desktop.
Save it-one-mm/fb7f01fd57d8f3efcc624287e51e2672 to your computer and use it in GitHub Desktop.
// Relational Operators
// == equal
// != not equal
// > greater than
// >= greater than or equal to
// < less than
// <= less than or equal to
// Logical Operators
// && AND
// || OR
// ! NOT
import 'dart:math';
void main() {
// if (codition) { instruction }
// if (codition) { ... } else { ... }
// if (codition) { ... }
// elseif (codition) { ... }...
// else { ... }
loveCalculator();
}
void loveCalculator() {
// int loveScore = 50;
int loveScore = Random().nextInt(100) + 1; // 1 - 100
print(loveScore);
if (loveScore == 100) {
print('အရမ်းချစ်');
} else if (loveScore >= 70) {
print('ချစ်ဘဲချစ်');
} else if (loveScore > 40) { // 40 - 60
print('ကြိုက်ဘဲကြိုက်');
} else {
print('မချစ်ကြပါ');
}
}
// true && true = true
// true && false = false
// false && false = false
// false || false = false
// true || false = true
// !true = false
// !false = true
// temparture >= 85 'hot'
// 70 - 84 'normal'
// < 70 'cool'
// < 30 'cold'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment