{"id":132,"date":"2026-03-27T14:00:58","date_gmt":"2026-03-27T14:00:58","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/l_smith\/?p=132"},"modified":"2026-03-27T14:00:58","modified_gmt":"2026-03-27T14:00:58","slug":"nba-all-star-day-1","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/l_smith\/2026\/03\/27\/nba-all-star-day-1\/","title":{"rendered":"NBA ALL STAR DAY 1"},"content":{"rendered":"\n<p>so im adding all star weekend only the 2nd great event for the nba beind the finals <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import random\nimport time\n\nclass Player:\n    def __init__(self, name, team, ovr, origin=\"USA\", skill_3pt=80, dunk_rating=80):\n        self.name = name\n        self.team = team\n        self.ovr = ovr\n        self.origin = origin\n        self.skill_3pt = skill_3pt\n        self.dunk_rating = dunk_rating\n\n# --- 2026 Season Official Star Pool ---\nall_players = &#91;\n    Player(\"Damian Lillard\", \"POR\", 92, \"USA\", 99, 82),\n    Player(\"Devin Booker\", \"PHX\", 94, \"USA\", 94, 85),\n    Player(\"Kon Knueppel\", \"CHA\", 83, \"USA\", 93, 75),\n    Player(\"Tyrese Maxey\", \"PHI\", 91, \"USA\", 91, 88),\n    Player(\"Donovan Mitchell\", \"CLE\", 92, \"USA\", 93, 94),\n    Player(\"Jamal Murray\", \"DEN\", 90, \"World\", 90, 84),\n    Player(\"Keshad Johnson\", \"MIA\", 78, \"USA\", 72, 98),\n    Player(\"Jaxson Hayes\", \"LAL\", 79, \"USA\", 65, 96),\n    Player(\"Jase Richardson\", \"ORL\", 77, \"USA\", 82, 97),\n    Player(\"Carter Bryant\", \"SAS\", 78, \"USA\", 80, 95),\n    Player(\"Luka Don\u010di\u0107\", \"LAL\", 98, \"World\", 95, 78),\n    Player(\"Nikola Joki\u0107\", \"DEN\", 98, \"World\", 88, 75),\n    Player(\"Victor Wembanyama\", \"SAS\", 95, \"World\", 86, 96),\n    Player(\"Anthony Edwards\", \"MIN\", 95, \"USA\", 89, 97),\n    Player(\"LeBron James\", \"LAL\", 94, \"USA\", 85, 92),\n    Player(\"Kevin Durant\", \"HOU\", 94, \"USA\", 92, 85),\n    Player(\"Jayson Tatum\", \"BOS\", 95, \"USA\", 91, 88),\n    Player(\"Shai Gilgeous-Alexander\", \"OKC\", 97, \"World\", 88, 85),\n    Player(\"Giannis Antetokounmpo\", \"MIL\", 96, \"World\", 78, 98)\n]\n\ndef run_all_star_weekend():\n    print(\"\ud83c\udf1f WELCOME TO ALL-STAR WEEKEND 2026 | Intuit Dome, Los Angeles \ud83c\udf1f\")\nclass allstarweekendevents:\n    # 1. THE 3-POINT CONTEST\n      print(\"\\n\ud83c\udfaf --- STATE FARM 3-POINT CONTEST ---\")\n      shooters = &#91;p for p in all_players if p.skill_3pt >= 85]\n      participants_3pt = random.sample(shooters, 8)\n      scores_3pt = &#91;]\n      for p in participants_3pt:\n        score = random.randint(18, 26) + (p.skill_3pt - 85) \/\/ 2\n        scores_3pt.append((p.name, score))\n        print(f\"{p.name} ({p.team}): {score} PTS\")\n        time.sleep(0.4)\n    \n      winner_3pt = max(scores_3pt, key=lambda x: x&#91;1])\n      print(f\"\ud83c\udfc6 3PT CHAMPION: {winner_3pt&#91;0]} with {winner_3pt&#91;1]} points!\")\n\n    # 2. THE SLAM DUNK CONTEST\n      print(\"\\n\ud83d\udc30 --- AT&amp;T SLAM DUNK CONTEST ---\")\n      dunkers = &#91;p for p in all_players if p.dunk_rating >= 94]\n      participants_dunk = random.sample(dunkers, 4)\n      scores_dunk = &#91;]\n      for p in participants_dunk:\n        score = random.randint(42, 50)\n        scores_dunk.append((p.name, score))\n        print(f\"{p.name} ({p.team}) clears the rack! Score: {score}\")\n        time.sleep(0.6)\n    \n      winner_dunk = max(scores_dunk, key=lambda x: x&#91;1])\n      print(f\"\ud83c\udfc6 DUNK CHAMPION: {winner_dunk&#91;0]} with a {winner_dunk&#91;1]}!\")\n\n    # 3. ROUND-ROBIN TOURNAMENT (Sunday Main Event)\n      print(\"\\n\ud83c\udfdf\ufe0f --- ALL-STAR ROUND-ROBIN TOURNAMENT ---\")\n      world = &#91;p for p in all_players if p.origin == \"World\"]\n      usa = &#91;p for p in all_players if p.origin == \"USA\"]\n    \n    # Randomly assign USA players to Stars or Stripes\n      random.shuffle(usa)\n      stripes = usa&#91;:len(usa)\/\/2]\n      stars = usa&#91;len(usa)\/\/2:]\n\n      teams = {\"Team World\": world, \"USA Stripes\": stripes, \"USA Stars\": stars}\n      for t_name, roster in teams.items():\n        print(f\"\\n{t_name}: {', '.join(&#91;p.name for p in roster&#91;:5]])}...\")\n\n    # Final result based on team OVR average\n   \n\nrun_all_star_weekend()\n<\/code><\/pre>\n\n\n\n<p>this sims all star weekend i was thinking about adding all star weekend for a while but i wasnt sure how so i asked ai and i fixed the draft clock its 15secnds but its runs down and if it runs out the sim has the cpu make the pick for you because i was wondering what happened so i let it run out and thats what happened has you can see from this code and screenshot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import threading\nimport time\nimport sys\n\nclass DraftTimer:\n    def __init__(self, seconds):\n        self.seconds = seconds\n        self.stop_event = threading.Event()\n        self.expired = False\n\n    def start_countdown(self):\n        \"\"\"Runs in the background and prints the remaining time.\"\"\"\n        for i in range(self.seconds, -1, -1):\n            if self.stop_event.is_set():\n                return\n            \n            # Use \\r to overwrite the same line in the console\n            sys.stdout.write(f\"\\r\u23f1\ufe0f  DRAFT CLOCK: {i}s remaining | 1. Pick  2. Trade: \")\n            sys.stdout.flush()\n            \n            if i == 0:\n                self.expired = True\n                print(\"\\n\\n\u274c TIME EXPIRED! The league office has made a pick for you.\")\n                # You can add logic here to auto-pick the best available player\n                return\n            time.sleep(1)\n\n    def stop(self):\n        self.stop_event.set()\n\n# --- Example Usage in your Game ---\ndef run_draft_turn():\n    # Set a 15-second clock\n    timer = DraftTimer(15)\n    \n    # Start the clock on a separate background thread\n    clock_thread = threading.Thread(target=timer.start_countdown)\n    clock_thread.daemon = True # Ensures thread dies if main program closes\n    clock_thread.start()\n\n    # The main program pauses here for input while the clock runs above\n    choice = input()\n    \n    # Once user types something, stop the background clock\n    timer.stop()\n\n    if timer.expired:\n        return \"AUTO_PICK\"\n    \n    if choice == \"1\":\n        return \"MAKING_PICK\"\n    elif choice == \"2\":\n        return \"VIEWING_TRADES\"\n    else:\n        return \"INVALID\"\n\nprint(\"--- NBA DRAFT 2026 ---\")\nresult = run_draft_turn()\nprint(f\"\\nDecision made: {result}\")\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"426\" height=\"57\" src=\"https:\/\/theroyalscode.com\/students\/l_smith\/wp-content\/uploads\/2026\/03\/image-6.png\" alt=\"\" class=\"wp-image-133\" srcset=\"https:\/\/theroyalscode.com\/students\/l_smith\/wp-content\/uploads\/2026\/03\/image-6.png 426w, https:\/\/theroyalscode.com\/students\/l_smith\/wp-content\/uploads\/2026\/03\/image-6-300x40.png 300w\" sizes=\"auto, (max-width: 426px) 100vw, 426px\" \/><\/figure>\n\n\n\n<p>if you have any ideas plaese  comment them in the comment area im open to ideas to make this sim better <\/p>\n\n\n\n<p>i will add awords next week awords like:<\/p>\n\n\n\n<p>MVP <\/p>\n\n\n\n<p>DPOTY<\/p>\n\n\n\n<p>OPOTY<\/p>\n\n\n\n<p>SIXTH MAN OF THE YEAR <\/p>\n\n\n\n<p>ROOKIE OF THE YEAR<\/p>\n\n\n\n<p>GM OF THE YEAR <\/p>\n\n\n\n<p>COACH OF THE YEAR<\/p>\n\n\n\n<p>MOST INPORVED PLAYER <\/p>\n\n\n\n<p>over the next weeks i will add all nba teams and all rookies teams  as well <\/p>\n\n\n\n<p>next week is spring break so no post next week but in 2 weeks we&#8217;re back and ill be back with more on this code <\/p>\n\n\n\n<p>until then stay cool guys<\/p>\n\n\n\n<p>see you in 2 weeks  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>so im adding all star weekend only the 2nd great event for the nba beind the finals this sims all star weekend i was thinking about adding all star weekend for a while but i wasnt sure how so i asked ai and i fixed the draft clock its 15secnds but its runs down and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/posts\/132\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}