<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Michael Oden</title>
    <description>The latest articles on Forem by Michael Oden (@michael_oden_2222df021275).</description>
    <link>https://forem.com/michael_oden_2222df021275</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F787327%2Fdc892699-3266-4380-ad5e-e00bf49f65e0.jpg</url>
      <title>Forem: Michael Oden</title>
      <link>https://forem.com/michael_oden_2222df021275</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/michael_oden_2222df021275"/>
    <language>en</language>
    <item>
      <title>How to create a fidget spinner using python.</title>
      <dc:creator>Michael Oden</dc:creator>
      <pubDate>Tue, 19 Jul 2022 11:11:20 +0000</pubDate>
      <link>https://forem.com/michael_oden_2222df021275/how-to-create-a-fidget-spinner-using-python-46oe</link>
      <guid>https://forem.com/michael_oden_2222df021275/how-to-create-a-fidget-spinner-using-python-46oe</guid>
      <description>&lt;p&gt;Hello, I got an idea for a practical example on how to create animations using python and I thought a fidget spinner showing three different colours will be brilliant.&lt;/p&gt;

&lt;p&gt;Here is a step by step breakdown of the code to help you create the same thing or something similar.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#How to create a Fidget Spinner game using python.

from turtle import *
state ={'turn': 0}
def spinner ():
    clear()
    angle = state['turn']/10
    right(angle)
    forward(100)
    dot(120, 'red')
    back(100)
    right(100)
    forward(100)
    dot(120, 'green')
    back(100)
    right(120)
    forward(100)
    dot(120, 'blue')
    back(100)
    right(120)
    update()
def animate():
    if state['turn']&amp;gt;0:
        state['turn']-=1
    spinner() 
    ontimer(animate, 20)
def flick():
    state['turn']+=10
setup(420, 420, 360, 0)
hideturtle()
tracer(False)
width(20)
onkey(flick, 'space')
listen()
animate()
done()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>programming</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
