{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import random\n\ndef get_user_choice():\n    user_choice = input(\"اختر (حجر، ورقة، مقص): \")\n    while user_choice.lower() not in ['حجر', 'ورقة', 'مقص']:\n        print(\"خيار غير صحيح. الرجاء إعادة المحاولة.\")\n        user_choice = input(\"اختر (حجر، ورقة، مقص): \")\n    return user_choice.lower()\n\ndef get_computer_choice():\n    choices = ['حجر', 'ورقة', 'مقص']\n    return random.choice(choices)\n\ndef determine_winner(user_choice, computer_choice):\n    if user_choice == computer_choice:\n        return \"تعادل!\"\n    elif (user_choice == 'حجر' and computer_choice == 'مقص') or \\\n         (user_choice == 'ورقة' and computer_choice == 'حجر') or \\\n         (user_choice == 'مقص' and computer_choice == 'ورقة'):\n        return \"أحسنت، فقد فزت!\"\n    else:\n        return \"آسف، لقد خسرت!\"\n\ndef play_game():\n    print(\"هيا بنا نلعب حجر ورقة مقص!\")\n    user_choice = get_user_choice()\n    computer_choice = get_computer_choice()\n    print(f\"اختيارك: {user_choice}\")\n    print(f\"اختيار الحاسوب: {computer_choice}\")\n    print(determine_winner(user_choice, computer_choice))\n\nif __name__ == \"__main__\":\n    play_game()","metadata":{"execution":{"iopub.status.busy":"2023-07-27T08:32:11.103575Z","iopub.execute_input":"2023-07-27T08:32:11.104043Z","iopub.status.idle":"2023-07-27T08:32:19.006088Z","shell.execute_reply.started":"2023-07-27T08:32:11.104008Z","shell.execute_reply":"2023-07-27T08:32:19.005175Z"},"trusted":true},"execution_count":null,"outputs":[]}]}