{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "aecc4769-512f-426b-ad35-c03597cdbe28",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello Max, I am Super Robo Man. Pick one of the following for ROSHAMBO!\n",
      "1. Rock\n",
      "2. Paper\n",
      "3. Scissors\n"
     ]
    },
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "Enter Your Move: 2\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Max chose Paper\n",
      "Super Robo Man chose Scissors\n",
      "Super Robo Man Wins!\n",
      "Max = 2 | Super Robo Man = 2\n"
     ]
    },
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "Want to go Again? y or n: n\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "FINAL SCORE: Max : 2 | Super Robo Man : 2\n",
      "GOODBYE\n"
     ]
    }
   ],
   "source": [
    "from random import randint\n",
    "from IPython.display import clear_output\n",
    "import sys\n",
    "\n",
    "\n",
    "roShamBo=['Rock','Paper','Scissors']\n",
    "enter_name=input(\"What Is Your Name?\")\n",
    "user_score=0\n",
    "comp_score=0\n",
    "comp_name='Super Robo Man'\n",
    "\n",
    "def endgame():\n",
    "    print(f\"{enter_name} = {user_score} | {comp_name} = {comp_score}\")\n",
    "    user_response=input(\"Want to go Again? y or n:\")\n",
    "    \n",
    "    if user_response == \"y\" or user_response == \"Y\":\n",
    "        clear_output()\n",
    "        main()\n",
    "    elif user_response == \"n\" or user_response == \"N\":\n",
    "        print(f\"FINAL SCORE: {enter_name} : {user_score} | {comp_name} : {comp_score}\")\n",
    "        print(\"GOODBYE\")\n",
    "        \n",
    "\n",
    "def main():\n",
    "    global user_score, comp_score\n",
    "    print(f\"Hello {enter_name}, I am {comp_name}. Pick one of the following for ROSHAMBO!\")\n",
    "    print(\"1. Rock\")\n",
    "    print(\"2. Paper\")\n",
    "    print(\"3. Scissors\")\n",
    "    comp_choice=roShamBo[randint(0,2)]\n",
    "    \n",
    "    user_choice=int(input('Enter Your Move:'))-1\n",
    "\n",
    "    user_input=roShamBo[user_choice]\n",
    "    print(f\"{enter_name} chose {user_input}\")\n",
    "    print(f\"{comp_name} chose {comp_choice}\")\n",
    "    \n",
    "    if user_input==comp_choice:\n",
    "        print(\"TIE\")\n",
    "        \n",
    "    elif user_input=='Rock':\n",
    "        if comp_choice=='Scissors':\n",
    "            print(f\"{enter_name} Wins!\")\n",
    "            user_score+=1\n",
    "        else:\n",
    "            print(f\"{comp_name} Wins!\")\n",
    "            comp_score+=1\n",
    "            \n",
    "    elif user_input=='Paper':\n",
    "        if comp_choice=='Rock':\n",
    "            print(f\"{enter_name} Wins!\")\n",
    "            user_score+=1\n",
    "        else:\n",
    "            print(f\"{comp_name} Wins!\")\n",
    "            comp_score+=1\n",
    "            \n",
    "    elif user_input=='Scissors':\n",
    "        if comp_choice=='Paper':\n",
    "            print(f\"{enter_name} Wins!\")\n",
    "            user_score+=1\n",
    "        else:\n",
    "            print(f\"{comp_name} Wins!\")\n",
    "            comp_score+=1\n",
    "    endgame()\n",
    "\n",
    "if __name__ == \"__main__\":\n",
    "    main()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "26de44e5-a53e-4141-9822-ac6eb49e012e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
