import 'dart:io'; // استيراد المكتبة void main() { // متغيرات بسيطة للحالة var lights = "OFF"; var temperature = 20; var security = "DISARMED"; print("Welcome to the Smart Home System!"); while (true) { print("\n1. Toggle lights"); print("2. Set temperature"); print("3. Security system"); print("4. Status"); print("5. Exit"); stdout.write("Choice: "); String? input = stdin.readLineSync(); if (input == "1") { if (lights == "OFF") { lights = "ON"; } else { lights = "OFF"; } print("Lights updated!"); } else if (input == "2") { print("Enter temp (15-30): "); int? newTemp = int.parse(stdin.readLineSync()!); if (newTemp >= 15 && newTemp <= 30) { temperature = newTemp; } else { print("Wrong temperature!"); } } else if (input == "3") { if (security == "DISARMED") { security = "ARMED"; } else { security = "DISARMED"; } print("Security updated!"); } else if (input == "4") { // منطق الكلمات الخاصة بالحرارة String note = ""; if (temperature % 3 == 0 && temperature % 5 == 0) { note = "Perfect Day"; } else if (temperature % 3 == 0) { note = "Cool Day"; } else if (temperature % 5 == 0) { note = "Warm Day"; } print("--- System Status ---"); print("Lights: $lights"); print("Temperature: $temperature $note"); print("Security: $security"); } else if (input == "5") { print("Goodbye!"); break; } } }