{"id":49,"date":"2025-12-05T15:42:29","date_gmt":"2025-12-05T15:42:29","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/r_najim\/?p=49"},"modified":"2025-12-05T15:42:29","modified_gmt":"2025-12-05T15:42:29","slug":"friday-december-5-2025","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/r_najim\/2025\/12\/05\/friday-december-5-2025\/","title":{"rendered":"Friday, December, 5 2025"},"content":{"rendered":"\n<p>Today This Free Friday I am working on a project on YouTube a Turtle racing Tutorial<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=NpmFbWO6HPU&amp;t=10765s\">https:\/\/www.youtube.com\/watch?v=NpmFbWO6HPU&amp;t=10765s<\/a><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>import turtle\n\ndef get_number_of_racerss():\n    racers = 0\n    while True:\n        racers = input('Enter the number of racers (2 - 10): ')\n        if racers.isdigit():\n            racers = int(racers)\n        else:\n            print('Input is not numeric... Try Again!')\n            continue\n\n        if 2 &lt;= racers &lt;= 10:\n            return racers\n        else:\n            print('Number not in range 2-10. Try Again!')\n\nracers = get_number_of_racerss()\nprint(racers)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This part of the code is to tells the users to Enter a number of racers and to make sure it is in the range of  racers in the code and make sure it is a number.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>def create_turtles(colors):\n    turtles = &#91;]\n    spacingx = WIDTH \/\/ (len(colors) + 1)\n    for i, color in enumerate(colors):\n        racer = turtle.Turtle()\n        racer.color(color)\n        racer.shape('turtle')\n        racer.left(90)\n        racer.penup()\n        racer.pendown()\n        racer.setpos(-WIDTH\/\/2 + (i + 1) * spacingx, -HEIGHT\/\/2 + 20)\n        racer.pendown()\n        turtles.append(racer)\n\n    return turtles<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This part of the code is to create the racing Turtle in the game<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>def race(colors):\n    turtles = create_turtles(colors)\n\n    while True:\n        for racer in turtles:\n            distance = random.randrange(1, 20)\n            racer.forward(distance)\n\n            x, y = racer.pos()\n            if y >= HEIGHT \/\/ 2 - 10:\n                return colors&#91;turtles.index(racer)]\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This part of the code is the race that the turtle racers race in the game.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today This Free Friday I am working on a project on YouTube a Turtle racing Tutorial<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts\/49\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}