{"id":6604,"date":"2021-01-18T19:40:47","date_gmt":"2021-01-18T14:10:47","guid":{"rendered":"https:\/\/copyassignment.com\/?p=6604"},"modified":"2022-11-30T19:22:57","modified_gmt":"2022-11-30T13:52:57","slug":"snake-game-with-python-turtle-graphics","status":"publish","type":"post","link":"https:\/\/copyassignment.com\/snake-game-with-python-turtle-graphics\/","title":{"rendered":"Snake Game with Python Turtle Graphics"},"content":{"rendered":"\n<p>In this tutorial, we will learn how to build the Snake Game with Python Turtle Graphics Module. By the end of this tutorial, you will learn about all the basic concepts of Python and advanced topics of python turtle. First, we will see the explanation where we will discuss the topic and then the actual code.<\/p>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Requirements:<\/h2>\n\n\n\n<p>We will need the turtle module which is built-in with Python. The next module we need is the &#8220;random&#8221; module which will be used to get a random coordinate to keep the food of the snake. However, if you get the <em>NoSuchModuleError<\/em>, try the following command in the terminal.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">First Part:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, import the &#8220;<strong>turtle<\/strong>&#8221; and the &#8220;<strong>random<\/strong>&#8221; module. Then, set the geometry of the screen as <strong>w = 500, h = 500, fs = 10 and d = 100<\/strong>.  Likewise, create a dictionary name &#8220;<strong>offsets<\/strong>&#8221; where there will be four name and values will be given in coordinates. Set the names and values as&nbsp;<strong>{ &#8220;up&#8221;:&nbsp;(0,&nbsp;20),&nbsp;&nbsp;&nbsp;&nbsp;&#8220;down&#8221;:&nbsp;(0,&nbsp;-20),&nbsp;&nbsp;&nbsp;&nbsp;&#8220;left&#8221;:&nbsp;(-20,&nbsp;0),&nbsp;&nbsp;&nbsp;&nbsp;&#8220;right&#8221;:&nbsp;(20,&nbsp;0) }<\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">The Snake Function:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Likewise, create a function named <strong>r()<\/strong> and declare &#8220;<strong>saap<\/strong>&#8220;,&nbsp;&#8220;<strong>kata<\/strong>&#8220;,&nbsp;&#8220;<strong>khanaT<\/strong>&#8220;,&nbsp;&#8220;<strong>pen<\/strong>&#8220;. Then create a list of lists as <strong>[[0,&nbsp;0],&nbsp;[0,&nbsp;20],&nbsp;[0,&nbsp;40],&nbsp;[0,&nbsp;60],&nbsp;[0,&nbsp;80]]<\/strong>. Similarly, set the <strong>kata<\/strong> to &#8220;<strong>up<\/strong>&#8221; and store <strong>nun()<\/strong> in <strong>khanaT<\/strong>. Position the food to <strong>khanaT<\/strong> and call the <strong>hall()<\/strong> function.<\/li>\n\n\n\n<li>Similarly, create a function named <strong>hall()<\/strong>. Inside this function, set a global variable name &#8220;<strong>kata<\/strong>&#8220;. Then, set a new_head variable to <strong>sapp[-1].copy()<\/strong> and so on as in the code below.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>new_head = saap&#91;-1].copy()\nnew_head&#91;0] = saap&#91;-1]&#91;0] + offsets&#91;kata]&#91;0]\nnew_head&#91;1] = saap&#91;-1]&#91;1] + offsets&#91;kata]&#91;1]<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create an if else condition where <strong>r()<\/strong> will be called if <strong>new_head<\/strong> is in <strong>sapp[:-1]<\/strong>. Else, the current will be appended to sapp. If it is not <strong>khana()<\/strong> pop the value in the first index. Create another condition where if <strong>saap[-1][0]<\/strong>&nbsp;greater than <strong>w&nbsp;\/&nbsp;2<\/strong>, subtract w from <strong>saap[-1][0]<\/strong>. Else if <strong>saap[-1][0]<\/strong>&nbsp;less than <strong>&#8211;&nbsp;w&nbsp;\/&nbsp;2<\/strong> , add <strong>w<\/strong> to <strong>saap[-1][0]<\/strong>. Else if <strong>saap[-1][1]<\/strong>&nbsp;greater than&nbsp;<strong>h&nbsp;\/&nbsp;2<\/strong>, subtract <strong>h<\/strong> from <strong>saap[-1][1]<\/strong>. At last if <strong>saap[-1][1]<\/strong>&nbsp;less than&nbsp;<strong>-h&nbsp;\/&nbsp;2<\/strong>,  add <strong>h<\/strong> to <strong>saap[-1][1]<\/strong>.<\/li>\n\n\n\n<li>Clear all the stamps and create a for loop that will loop through saap. Inside this loop, make the turtle go to the first index of the segment as &#8220;x&#8221; and the second index of the segment as &#8220;y&#8221; and stamp with the pen.<\/li>\n\n\n\n<li>Update the screen and call the ontimer method of the turtle with the arguments (hall, d)<\/li>\n<\/ul>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h3 class=\"wp-block-heading\">Food and Positioning Part:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a function name <strong>khana() <\/strong>and set the <strong>khanaT<\/strong> variable as global. If &nbsp;<strong>dist(saap[-1],&nbsp;khanaT)<\/strong> is less than 20, store the <strong>nun()<\/strong> function in <strong>khanaT<\/strong> and position the &#8220;<strong>food<\/strong>&#8221; variable to <strong>khanaT<\/strong> and return <strong>Ture<\/strong> else return <strong>False<\/strong>.<\/li>\n\n\n\n<li>Create another function named <strong>nun()<\/strong>. In this function, we will declare the position of the food for the snake with the following code.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>x = random.randint(- w \/ 2 + fs, w \/ 2 - fs)\ny = random.randint(- h \/ 2 + fs, h \/ 2 - fs)\nreturn (x, y)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create another function named <strong>dist()<\/strong> with the parameters &#8220;<strong>poos1<\/strong>&#8221; and &#8220;<strong>poos2<\/strong>&#8220;. Inside this function, set the poos1 as x1 and y1 and poos2 as x2 and y2. Declare the variable &#8220;distance&#8221; as <strong>((y2&nbsp;&#8211;&nbsp;y1)&nbsp;**&nbsp;2&nbsp;+&nbsp;(x2&nbsp;&#8211;&nbsp;x1)&nbsp;**&nbsp;2)&nbsp;**&nbsp;0.5<\/strong> and return the <strong>distance<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Moves of the snake:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a function named <strong>mathi()<\/strong>. Inside this function, set a global variable kata and if kata is not &#8220;down&#8221;, set kata as &#8220;up&#8221;.<\/li>\n\n\n\n<li>Likewise, create another function named go_right(). Inside this function, set a global variable kata and if kata is not &#8220;left&#8221;, set kata as &#8220;left&#8221;.<\/li>\n\n\n\n<li>Similarly, create another function named go_down(). Inside this function, set a global variable kata and if kata is not &#8220;up&#8221;, set kata as &#8220;down&#8221;.<\/li>\n\n\n\n<li>Accordingly, create another function named go_left(). Inside this function, set a global variable kata and if kata is not &#8220;right&#8221;, set kata as &#8220;left&#8221;.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Main Code as Last Part:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Declare a variable named screen as the screen of the turtle. Set the screen&#8217;s geometry up as the (w, h). Set the title of the turtle to &#8220;Snake Game&#8221; and the background color to &#8220;green&#8221;. Again, condition the setup to (500, 500). Call the tracer method with the argument &#8220;0&#8221;.<\/li>\n\n\n\n<li>Declare a variable name &#8220;pen&#8221; as the actual turtle and set the shape of the turtle as &#8220;square&#8221;. Pick the pen up as we are not ready to draw.<\/li>\n\n\n\n<li>Declare a variable named &#8220;food&#8221; and set it as a turtle. Set the shape of the turtle as &#8220;circle&#8221; and the color of the turtle as &#8220;white&#8221;. Call the shapesize method with the argument (fs \/ 20). Pick the pen up as we are not ready to draw. <\/li>\n\n\n\n<li>Then, call the listen() method to focus on the TurtleScreen. After the focus, to record the KeyEvents, call the onkey() method with the arguments (mathi, &#8220;up&#8221;), screen.onkey(go_right,&nbsp;&#8220;Right&#8221;), screen.onkey(go_down,&nbsp;&#8220;Down&#8221;), screen.onkey(go_left,&nbsp;&#8220;Left&#8221;).<\/li>\n\n\n\n<li>Lastly, call the r() function and end the code with the method turtle.done()<\/li>\n<\/ul>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Complete code for Snake Game with Python Turtle Graphics:<\/h2>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><div style=\"position:absolute;top:-20px;right:0px;cursor:pointer\" class=\"copy-simple-code-block\"><span class=\"dashicon dashicons dashicons-admin-page\"><\/span><\/div><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"python\" data-theme=\"xcode\" data-fontsize=\"14\" data-lines=\"Infinity\" data-showlines=\"true\" data-copy=\"true\">import turtle\nimport random\n\nw = 500\nh = 500\nfs = 10\nd = 100  # milliseconds\n\noffsets = {\n    \"up\": (0, 20),\n    \"down\": (0, -20),\n    \"left\": (-20, 0),\n    \"right\": (20, 0)\n}\n\ndef r():\n    global saap, kata, khanaT, pen\n    saap = [[0, 0], [0, 20], [0, 40], [0, 60], [0, 80]]\n    kata = \"up\"\n    khanaT = nun()\n    food.goto(khanaT)\n    hall()\n\ndef hall():\n    global kata\n\n    new_head = saap[-1].copy()\n    new_head[0] = saap[-1][0] + offsets[kata][0]\n    new_head[1] = saap[-1][1] + offsets[kata][1]\n\n    if new_head in saap[:-1]:  \n        r()\n    else:\n        saap.append(new_head)\n\n        if not khana():\n            saap.pop(0)  \n\n        if saap[-1][0] > w \/ 2:\n            saap[-1][0] -= w\n        elif saap[-1][0] &lt; - w \/ 2:\n            saap[-1][0] += w\n        elif saap[-1][1] > h \/ 2:\n            saap[-1][1] -= h\n        elif saap[-1][1] &lt; -h \/ 2:\n            saap[-1][1] += h\n\n        pen.clearstamps()\n #clears all the stamps\n\n        for segment in saap:\n            pen.goto(segment[0], segment[1])\n            pen.stamp()\n\n        screen.update()\n #updates the turtle.screen screen\n\n        turtle.ontimer(hall, d)\n\ndef khana():\n    global khanaT\n    if dist(saap[-1], khanaT) &lt; 20:\n        khanaT = nun()\n        food.goto(khanaT)\n        return True\n    return False\n\ndef nun():\n    x = random.randint(- w \/ 2 + fs, w \/ 2 - fs)\n    y = random.randint(- h \/ 2 + fs, h \/ 2 - fs)\n    return (x, y)\n\ndef dist(poos1, poos2):\n    x1, y1 = poos1\n    x2, y2 = poos2\n    distance = ((y2 - y1) ** 2 + (x2 - x1) ** 2) ** 0.5\n    return distance\n\ndef mathi():\n    global kata\n    if kata != \"down\":\n        kata = \"up\"\n\ndef go_right():\n    global kata\n    if kata != \"left\":\n        kata = \"right\"\n\ndef go_down():\n    global kata\n    if kata != \"up\":\n        kata = \"down\"\n\ndef go_left():\n    global kata\n    if kata != \"right\":\n        kata = \"left\"\n\nscreen = turtle.Screen()\nscreen.setup(w, h)\nscreen.title(\"saap\")\nscreen.bgcolor(\"green\")\nscreen.setup(500, 500)\nscreen.tracer(0)\n\npen = turtle.Turtle(\"square\")\npen.penup()\n\nfood = turtle.Turtle()\nfood.shape(\"circle\")\nfood.color(\"white\")\nfood.shapesize(fs \/ 20) \nfood.penup()\n\nscreen.listen()\nscreen.onkey(mathi, \"Up\")\nscreen.onkey(go_right, \"Right\")\nscreen.onkey(go_down, \"Down\")\nscreen.onkey(go_left, \"Left\")\n\nr()\nturtle.done()<\/pre><\/div>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Output:<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"490\" height=\"383\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/snake1.jpg\" alt=\"Snake Game with Python Turtle Graphics\" class=\"wp-image-5991 lazyload\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/snake1.jpg 490w, https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/snake1-300x234.jpg 300w\" data-sizes=\"(max-width: 490px) 100vw, 490px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 490px; --smush-placeholder-aspect-ratio: 490\/383;\" \/><\/figure>\n\n\n\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-9886351916045880\"\n     crossorigin=\"anonymous\"><\/script>\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-format=\"autorelaxed\"\n     data-ad-client=\"ca-pub-9886351916045880\"\n     data-ad-slot=\"7933252109\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>Thank You for reading till the end. If you have any queries or confusion, just comment it down. We also have a <a href=\"https:\/\/copyassignment.com\/the-beginners-guide-to-python-turtle\/\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Beginner&#8217;s Guide to Python Turtle<\/a>. We even have other minor and medium projects on Python Turtle on this website.<\/p>\n\n\n\n<p><strong>Keep <em>Learning<\/em>, Keep <em>Coding<\/em><\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p style=\"font-size:26px\"><strong>Also Read:<\/strong><\/p>\n\n\n<ul class=\"wp-block-latest-posts__list is-grid columns-3 wp-block-latest-posts\"><li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/radha-krishna-using-python-turtle\/\">Radha Krishna using Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/drawing-letter-a-using-python-turtle\/\">Drawing letter A using Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/stickman-game-in-python\/\">Stickman Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/brick-breaker-game-in-python\/\">Brick Breaker Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/wishing-happy-new-year-2023-in-python-turtle\/\">Wishing Happy New Year 2023 in Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/tank-game-in-python\/\">Tank game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/gui-piano-in-python\/\">GUI Piano in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/ludo-game-in-python\/\">Ludo Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/rock-paper-scissors-game-in-python\/\">Rock Paper Scissors Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/snake-and-ladder-game-in-python\/\">Snake and Ladder Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/puzzle-game-in-python\/\">Puzzle Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/draw-goku-in-python-turtle\/\">Draw Goku in Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/draw-mickey-mouse-in-python-turtle\/\">Draw Mickey Mouse in Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/creating-dino-game-in-python\/\">Creating Dino Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/tic-tac-toe-game-in-python\/\">Tic Tac Toe Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/happy-diwali-in-python-turtle\/\">Happy Diwali in Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/draw-halloween-in-python-turtle\/\">Draw Halloween in Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/write-happy-halloween-in-python-turtle\/\">Write Happy Halloween in Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/draw-happy-diwali-in-python-turtle\/\">Draw Happy Diwali in Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/tetris-game-in-python-code\/\">Tetris game in Python Code<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/extract-audio-from-video-using-python\/\">Extract Audio from Video using Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/drawing-application-in-python-tkinter\/\">Drawing Application in Python Tkinter<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/draw-flag-of-usa-using-python-turtle\/\">Draw Flag of USA using Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/draw-iron-man-face-with-python-turtle-tony-stark-face\/\">Draw Iron Man Face with Python Turtle: Tony Stark Face<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/draw-tiktok-logo-with-python-turtle\/\">Draw TikTok Logo with Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/python-games-code-copy-and-paste\/\">Python Games Code | Copy and Paste<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/draw-instagram-logo-using-python-turtle\/\">Draw Instagram Logo using Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/i-love-you-text-in-ascii-art\/\">I Love You Text in ASCII Art<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/python-turtle-shapes-square-rectangle-circle\/\">Python Turtle Shapes- Square, Rectangle, Circle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/python-turtle-commands-and-all-methods\/\">Python Turtle Commands and All Methods<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will learn how to build the Snake Game with Python Turtle Graphics Module. By the end of this tutorial, you will&#8230;<\/p>\n","protected":false},"author":62,"featured_media":12586,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,1060,1067],"tags":[1379,1642,1639,1635,1644,1640,1643,1645,1080,1677,1198,1100,1744],"class_list":["post-6604","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-allcategorites","category-game-in-python","category-python-turtle","tag-game-in-python","tag-make-snake-game-in-python","tag-pygame-snake-game","tag-python-code-for-snake-game","tag-python-snake-game-code-copy-and-paste","tag-python-snake-game-code-without-pygame","tag-python-snake-game-tutorial","tag-python-snake-tutorial","tag-python-turtle","tag-python-turtle-projects","tag-snake-game-with-python-turtle-graphics","tag-turtle-python","tag-turtle-python-projects","wpcat-22-id","wpcat-1060-id","wpcat-1067-id"],"_links":{"self":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/posts\/6604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/comments?post=6604"}],"version-history":[{"count":0,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/posts\/6604\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/media\/12586"}],"wp:attachment":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/media?parent=6604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/categories?post=6604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/tags?post=6604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}