<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Pynix by Pynix</title>
      <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff</link>
      <description>Inspire the world with your creations</description>
      <language>en-us</language>
      <pubDate>2020-11-17 16:18:46 UTC</pubDate>
      <lastBuildDate>2025-10-02 07:13:34 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>Age Detection with Date, Year and Month</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932492562</link>
         <description><![CDATA[<div>def findage(current_date,current_month,current_year,birth_date,birth_month,birth_year):<br>   month=[31,28,31,30,31,30,31,31,30,31,30,31]<br>   if(birth_date&gt;current_date):<br>      current_month=current_month-1<br>      current_date=current_date+month[birth_month-1]<br><br>   if(birth_month&gt;current_month):<br>      current_year=current_year-1<br>      current_month=current_month+12<br>   calculated_date=current_date-birth_date<br>   calculated_month=current_month-birth_month<br>   calculated_year=current_year-birth_year<br>   print("Present Age")<br>   print("Years:",calculated_year,"Months:",calculated_month,"Days:",calculated_date)<br><br>current_date=eval(input("enter the current_date:"))<br>current_month=eval(input("enter the current_month:"))<br>current_year=eval(input("enter the current_year:"))<br><br>birth_date=eval(input("enter the birth_date:"))<br>birth_month=eval(input("enter the birth_month:"))<br>birth_year=eval(input("enter the birth_year:"))<br>findage(current_date,current_month,current_year,birth_date,birth_month,birth_year)<br>      <br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/ab1fcaa022ae1093018639ff57c95639/images.jpeg" />
         <pubDate>2020-11-17 16:19:19 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932492562</guid>
      </item>
      <item>
         <title>Analouge</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932511700</link>
         <description><![CDATA[<div>import turtle<br>import time<br>wndw = turtle.Screen()<br>wndw.bgcolor("black")<br>wndw.setup(width=600, height=600)<br>wndw.title("Analogue Clock")<br>wndw.tracer(0)<br># Create the drawing pen<br>pen = turtle.Turtle()<br>pen.hideturtle()<br>pen.speed(0)<br>pen.pensize(3)<br>def draw_clock(hr, mn, sec, pen):<br>    # Draw clock face<br>    pen.up()<br>    pen.goto(0, 210)<br>    pen.setheading(180)<br>    pen.color("green")<br>    pen.pendown()<br>    pen.circle(210)<br>    # Draw hour hashes<br>    pen.up()<br>    pen.goto(0, 0)<br>    pen.setheading(90)<br>    for _ in range(12):<br>        pen.fd(190)<br>        pen.pendown()<br>        pen.fd(20)<br>        pen.penup()<br>        pen.goto(0, 0)<br>        pen.rt(30)<br>    # Draw the hands<br>    # Each tuple in list hands describes the color, the length<br>    # and the divisor for the angle<br>    hands = [("white", 80, 12), ("blue", 150, 60), ("red", 110, 60)]<br>    time_set = (hr, mn, sec)<br>    for hand in hands:<br>        time_part = time_set[hands.index(hand)]<br>        angle = (time_part/hand[2])*360<br>        pen.penup()<br>        pen.goto(0, 0)<br>        pen.color(hand[0])<br>        pen.setheading(90)<br>        pen.rt(angle)<br>        pen.pendown()<br>        pen.fd(hand[1])<br>while True:<br>    hr = int(time.strftime("%I"))<br>    mn = int(time.strftime("%M"))<br>    sec = int(time.strftime("%S"))<br>    draw_clock(hr, mn, sec, pen)<br>    wndw.update()<br>    time.sleep(1)<br>    pen.clear()<br>wndw.mainloop()<br><br><br><br><br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/e6919033b7c8758aec31abbc05e96ea2/images.jpeg" />
         <pubDate>2020-11-17 16:22:39 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932511700</guid>
      </item>
      <item>
         <title>Zodiac Sign Detector</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932631565</link>
         <description><![CDATA[<div>def zodiac_sign(day, month): <br>      <br>    # checks month and date within the valid range <br>    # of a specified zodiac <br>    if month == 'december': <br>        astro_sign = 'Sagittarius' if (day &lt; 22) else 'capricorn'<br>          <br>    elif month == 'january': <br>        astro_sign = 'Capricorn' if (day &lt; 20) else 'aquarius'<br>          <br>    elif month == 'february': <br>        astro_sign = 'Aquarius' if (day &lt; 19) else 'pisces'<br>          <br>    elif month == 'march': <br>        astro_sign = 'Pisces' if (day &lt; 21) else 'aries'<br>          <br>    elif month == 'april': <br>        astro_sign = 'Aries' if (day &lt; 20) else 'taurus'<br>          <br>    elif month == 'may': <br>        astro_sign = 'Taurus' if (day &lt; 21) else 'gemini'<br>          <br>    elif month == 'june': <br>        astro_sign = 'Gemini' if (day &lt; 21) else 'cancer'<br>          <br>    elif month == 'july': <br>        astro_sign = 'Cancer' if (day &lt; 23) else 'leo'<br>          <br>    elif month == 'august': <br>        astro_sign = 'Leo' if (day &lt; 23) else 'virgo'<br>          <br>    elif month == 'september': <br>        astro_sign = 'Virgo' if (day &lt; 23) else 'libra'<br>          <br>    elif month == 'october': <br>        astro_sign = 'Libra' if (day &lt; 23) else 'scorpio'<br>          <br>    elif month == 'november': <br>        astro_sign = 'scorpio' if (day &lt; 22) else 'sagittarius'<br>          <br>    print("your astrological sign is:",astro_sign) <br>      <br># Driver code  <br>if __name__ == '__main__': <br>    day = int(input('enter the date:'))<br>    month = input("enter the monthe:")<br>    zodiac_sign(day, month) </div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/1e9a8ec2ab0e350cb4726993021e2087/images.jpeg" />
         <pubDate>2020-11-17 16:42:45 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932631565</guid>
      </item>
      <item>
         <title>ATM prototype(user1 pwd 111)</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932652792</link>
         <description><![CDATA[<div>#!/usr/bin/python<br>import getpass<br>import string<br>import os<br><br># creatinga lists of users, their PINs and bank statements<br>users = ['user1', 'user2', 'user3']<br>pins = ['1111', '2222', '3333']<br>amounts = [1000, 2000, 3000]<br>count = 0<br># while loop checks existance of the enterd username<br>while True:<br>	user = input('\nENTER USER NAME: ')<br>	user = user.lower()<br>	if user in users:<br>		if user == users[0]:<br>			n = 0<br>		elif user == users[1]:<br>			n = 1<br>		else:<br>			n = 2<br>		break<br>	else:<br>		print('----------------')<br>		print('****************')<br>		print('INVALID USERNAME')<br>		print('****************')<br>		print('----------------')<br><br># comparing pin<br>while count &lt; 3:<br>	print('------------------')<br>	print('******************')<br>	pin = str(getpass.getpass('PLEASE ENTER PIN: '))<br>	print('******************')<br>	print('------------------')<br>	if pin.isdigit():<br>		if user == 'user1':<br>			if pin == pins[0]:<br>				break<br>			else:<br>				count += 1<br>				print('-----------')<br>				print('***********')<br>				print('INVALID PIN')<br>				print('***********')<br>				print('-----------')<br>				print()<br><br>		if user == 'user2':<br>			if pin == pins[1]:<br>				break<br>			else:<br>				count += 1<br>				print('-----------')<br>				print('***********')<br>				print('INVALID PIN')<br>				print('***********')<br>				print('-----------')<br>				print()<br>				<br>		if user == 'user3':<br>			if pin == pins[2]:<br>				break<br>			else:<br>				count += 1<br>				print('-----------')<br>				print('***********')<br>				print('INVALID PIN')<br>				print('***********')<br>				print('-----------')<br>				print()<br>	else:<br>		print('------------------------')<br>		print('************************')<br>		print('PIN CONSISTS OF 4 DIGITS')<br>		print('************************')<br>		print('------------------------')<br>		count += 1<br>	<br># in case of a valid pin- continuing, or exiting<br>if count == 3:<br>	print('-----------------------------------')<br>	print('***********************************')<br>	print('3 UNSUCCESFUL PIN ATTEMPTS, EXITING')<br>	print('!!!!!YOUR CARD HAS BEEN LOCKED!!!!!')<br>	print('***********************************')<br>	print('-----------------------------------')<br>	exit()<br><br>print('-------------------------')<br>print('*************************')<br>print('LOGIN SUCCESFUL, CONTINUE')<br>print('*************************')<br>print('-------------------------')<br>print()<br>print('--------------------------')<br>print('**************************')	<br>print(str.capitalize(users[n]), 'welcome to ATM')<br>print('**************************')<br>print('----------ATM SYSTEM-----------')<br># Main menu<br>while True:<br>	#os.system('clear')<br>	print('-------------------------------')<br>	print('*******************************')<br>	response = input('SELECT FROM FOLLOWING OPTIONS: \nStatement__(S) \nWithdraw___(W) \nLodgement__(L)  \nChange PIN_(P)  \nQuit_______(Q) \n: ').lower()<br>	print('*******************************')<br>	print('-------------------------------')<br>	valid_responses = ['s', 'w', 'l', 'p', 'q']<br>	response = response.lower()<br>	if response == 's':<br>		print('---------------------------------------------')<br>		print('*********************************************')<br>		print(str.capitalize(users[n]), 'YOU HAVE ', amounts[n],'EURO ON YOUR ACCOUNT.')<br>		print('*********************************************')<br>		print('---------------------------------------------')<br>		<br>	elif response == 'w':<br>		print('---------------------------------------------')<br>		print('*********************************************')<br>		cash_out = int(input('ENTER AMOUNT YOU WOULD LIKE TO WITHDRAW: '))<br>		print('*********************************************')<br>		print('---------------------------------------------')<br>		if cash_out%10 != 0:<br>			print('------------------------------------------------------')<br>			print('******************************************************')<br>			print('AMOUNT YOU WANT TO WITHDRAW MUST TO MATCH 10 EURO NOTES')<br>			print('******************************************************')<br>			print('------------------------------------------------------')<br>		elif cash_out &gt; amounts[n]:<br>			print('-----------------------------')<br>			print('*****************************')<br>			print('YOU HAVE INSUFFICIENT BALANCE')<br>			print('*****************************')<br>			print('-----------------------------')<br>		else:<br>			amounts[n] = amounts[n] - cash_out<br>			print('-----------------------------------')<br>			print('***********************************')<br>			print('YOUR NEW BALANCE IS: ', amounts[n], 'EURO')<br>			print('***********************************')<br>			print('-----------------------------------')<br>			<br>	elif response == 'l':<br>		print()<br>		print('---------------------------------------------')<br>		print('*********************************************')<br>		cash_in = int(input('ENTER AMOUNT YOU WANT TO LODGE: '))<br>		print('*********************************************')<br>		print('---------------------------------------------')<br>		print()<br>		if cash_in%10 != 0:<br>			print('----------------------------------------------------')<br>			print('****************************************************')<br>			print('AMOUNT YOU WANT TO LODGE MUST TO MATCH 10 EURO NOTES')<br>			print('****************************************************')<br>			print('----------------------------------------------------')<br>		else:<br>			amounts[n] = amounts[n] + cash_in<br>			print('----------------------------------------')<br>			print('****************************************')<br>			print('YOUR NEW BALANCE IS: ', amounts[n], 'EURO')<br>			print('****************************************')<br>			print('----------------------------------------')<br>	elif response == 'p':<br>		print('-----------------------------')<br>		print('*****************************')<br>		new_pin = str(getpass.getpass('ENTER A NEW PIN: '))<br>		print('*****************************')<br>		print('-----------------------------')<br>		if new_pin.isdigit() and new_pin != pins[n] and len(new_pin) == 4:<br>			print('------------------')<br>			print('******************')<br>			new_ppin = str(getpass.getpass('CONFIRM NEW PIN: '))<br>			print('*******************')<br>			print('-------------------')<br>			if new_ppin != new_pin:<br>				print('------------')<br>				print('************')<br>				print('PIN MISMATCH')<br>				print('************')<br>				print('------------')<br>			else:<br>				pins[n] = new_pin<br>				print('NEW PIN SAVED')<br>		else:<br>			print('-------------------------------------')<br>			print('*************************************')<br>			print('   NEW PIN MUST CONSIST OF 4 DIGITS \nAND MUST BE DIFFERENT TO PREVIOUS PIN')<br>			print('*************************************')<br>			print('-------------------------------------')<br>	elif response == 'q':<br>		exit()<br>	else:<br>		print('------------------')<br>		print('******************')<br>		print('RESPONSE NOT VALID')<br>		print('******************')<br>		print('------------------')</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/654572422f93b8c90bafed8e255434dd/download__3_.jpeg" />
         <pubDate>2020-11-17 16:46:27 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932652792</guid>
      </item>
      <item>
         <title>BMI Calculator</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932667568</link>
         <description><![CDATA[<div>name1=input("enter the first name:")<br>height_m1=eval(input("enter the first height:"))<br>weight_kg1=eval(input("enter the first weight:"))<br><br>name2= input("enter the second name:")<br>height_m2=eval(input("enter the second height:"))<br>weight_kg2=eval(input("enter the second weight:"))<br><br>name3=input("enter the third name:")<br>height_m3=eval(input("enter the third height:"))<br>weight_kg3=eval(input("enter the third weight:"))<br><br>name4=input("enter the forth name:")<br>height_m4=eval(input("enter the forth height:"))<br>weight_kg4=eval(input("enter the forth weight:"))<br><br>def bmi_calculator(name, height_m,weight_kg):<br>     bmi = weight_kg/(height_m**2)<br>     print("bmi:")<br>     print(bmi)<br>     if bmi&lt;25:<br>          return name + " is not over weight"<br>     else:<br>           return name + " is overweight"<br><br>result1=bmi_calculator(name1, height_m1,weight_kg1)<br>result2=bmi_calculator(name2, height_m2,weight_kg2)<br>result3=bmi_calculator(name3, height_m3,weight_kg3)<br>result4=bmi_calculator(name4, height_m4,weight_kg4)<br><br>print(result1)<br>print(result2)<br>print(result3)<br>print(result4)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/36bcf8ec52cf5badea19fe29bdcb497a/download__2_.jpeg" />
         <pubDate>2020-11-17 16:48:55 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932667568</guid>
      </item>
      <item>
         <title>Browser Prototype</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932691712</link>
         <description><![CDATA[<div>import tkinter as tk<br>import webbrowser<br> <br>class Check:<br>    """ create checkbuttons for links """<br>    def __init__(self, master, site):<br>        self.var = tk.IntVar()<br>        self.site = site<br>        self = tk.Checkbutton(<br>            master,<br>            text = self.site,<br>            variable = self.var,<br>            command = self.check).pack()<br> <br>    def check(self):<br>        v = self.var.get() # 1 checked 0 unchecked<br>        if v:<br>            checked.append(self.site)<br>        else:<br>            if self.site in checked:<br>                checked.remove(self.site)<br> <br>class App:<br>    def __init__(self, sites):<br>        """creates the window"""<br>        c = []<br>        master = tk.Tk()<br>        for site in sites:<br>            c.append(Check(master, site))<br>        tk.Button(<br>            master,<br>            text = "Launch",<br>            command = self.start).pack()<br>        master.mainloop()<br> <br>    def start(self):<br>        chrome = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"<br>        w = webbrowser.get(chrome)<br>        for checked_site in checked:<br>            w.open(checked_site)<br> <br>checked = []<br>app = App([<br>    "https://www.facebook.com/",<br>    "https://www.instagram.com/",<br>    "https://twitter.com/login", <br>    ])</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/6ec019e9abed86f5a79d01100b97ae16/download__1_.jpeg" />
         <pubDate>2020-11-17 16:53:03 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/932691712</guid>
      </item>
      <item>
         <title>Calendar</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934876793</link>
         <description><![CDATA[<div># import all functions from the tkinter<br>from tkinter import *<br><br>from tkinter import ttk<br><br>#import Calendar module<br>import calendar<br><br>def showCal():<br>    <br>    #new calendar window<br>    new_window = Tk()<br><br>    #setting the background color of GUI application<br>    new_window.config(background = 'white')<br><br>    #setting the title of the GUI application<br>    new_window.title("Calendar")<br><br>    #setting the geometry of the GUI application<br>    new_window.geometry('550x600')<br><br>    # get method returns current text as string <br>    fetch_year = int(year_field.get()) <br>  <br>    # calendar method of calendar module return <br>    # the calendar of the given year . <br>    cal_content = calendar.calendar(fetch_year) <br>  <br>    # Create a label for showing the content of the calender <br>    cal_year = Label(new_window, text = cal_content, font = "Consolas 10 bold") <br>  <br>    # grid method is used for placing  <br>    # the widgets at respective positions  <br>    # in table like structure. <br>    cal_year.grid(row = 5, column = 1, padx = 20) <br>      <br>    # start the GUI  <br>    new_window.mainloop()<br><br><br>if __name__=='__main__':<br><br>    #Create the basic gui window<br>    root = Tk()<br><br>    #setting the background color of GUI application<br>    root.config(background = 'white')<br><br>    #setting the title of the GUI application<br>    root.title("HOME")<br><br>    #setting the geometry of the GUI application<br>    root.geometry('500x400')<br><br>    # Create a CALENDAR : label with specified font and size <br>    cal = Label(root, text = "Welcome to the calendar Application", bg = "Red", font = ("times", 20, 'bold')) <br><br>    #Create a Year label : a label to ask the user for year<br>    year = Label(root, text = 'Please enter a year',bg = 'Green')<br><br>    #Create a Year Entry : Entry<br>    year_field = Entry(root)<br><br>    # Create a Show Calendar Button and attached to showCal function <br>    Show = Button(root, text = "Show Calendar", fg = "Black", bg = "Light Green", command = showCal)<br><br>    # Create a Exit Button and attached to exit function <br>    Exit = Button(root, text = "Exit", fg = "Black", bg = "Light Green", command = exit) <br>      <br>    # grid method is used for placing  <br>    # the widgets at respective positions  <br>    # in table like structure. <br>    cal.grid(row = 1, column = 1) <br>  <br>    year.grid(row = 2, column = 1) <br>  <br>    year_field.grid(row = 3, column = 1) <br>  <br>    Show.grid(row = 4, column = 1) <br>  <br>    Exit.grid(row = 6, column = 1) <br>      <br>    # start the GUI  <br>    root.mainloop() </div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/1317efe0370a60649499e6f3d726f273/images.jpeg" />
         <pubDate>2020-11-18 03:25:23 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934876793</guid>
      </item>
      <item>
         <title>Jarvix Chatbot</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934897857</link>
         <description><![CDATA[<div>reflections = {<br>  "i am"       : "you are",<br>  "i was"      : "you were",<br>  "i"          : "you",<br>  "i'm"        : "you are",<br>  "i'd"        : "you would",<br>  "i've"       : "you have",<br>  "i'll"       : "you will",<br>  "my"         : "your",<br>  "you are"    : "I am",<br>  "you were"   : "I was",<br>  "you've"     : "I have",<br>  "you'll"     : "I will",<br>  "your"       : "my",<br>  "yours"      : "mine",<br>  "you"        : "me",<br>  "me"         : "you",<br> "go"          : "gone",<br> "hello"      : "hey there"<br>}<br><br>from nltk.chat.util import Chat, reflections<br>pairs = [<br>    [<br>        r"my name is (.*)",<br>        ["Hello %1, How are you today ?",]<br>    ],<br>     [<br>        r"what is your name ?",<br>        ["My name is Jarvis and I'm a chatbot ?",]<br>    ],<br>    [<br>        r"how are you ?",<br>        ["I'm doing good\nHow about You ?",]<br>    ],<br>    [<br>        r"What can you do ?",<br>        ["I can assist, guide and spend time with you",]<br>    ],<br>    [<br>        r"how do I look like?",<br>        ["you are looking Gorgeous",]<br>    ],<br>    [<br>        r" What are your Hobbies?",<br>        ["Most of the time I spend with you, you my whole world",]<br>    ],<br>    [<br>        r"sorry (.*)",<br>        ["Its alright","Its OK, never mind",]<br>    ],<br>    [<br>        r"i'm (.*) doing good",<br>        ["Nice to hear that","Alright :)",]<br>    ],<br>    [<br>        r"hai|hi|hey|hello",<br>        ["Hello", "Hey there",]<br>    ],<br>    [<br>        r"(.*) age?|(.*) old are you?",<br>        ["I'm a computer program dude\nSeriously you are asking me this?",]<br>        <br>    ],<br>    [<br>        r"what (.*) want ?",<br>        ["Make me an offer I can't refuse",]<br>        <br>    ],<br>    [<br>        r"(.*) weather today ?",<br>        ["'it's pretty good","it's worser than ever"]<br>    ],<br>    [<br>        r"(.*) created ?",<br>        ["Sarang created me using Python's NLTK library ","top secret ;)",]<br>    ],<br>    [<br>        r"(.*) (location|city) ?",<br>        ['Kozhikode, Kerala',]<br>    ],<br>    [<br>        r"(.*) hobbies ?",<br>        ["My hobbies are spending time with you", "you are my world",]<br>    ],<br>    [<br>        r"how is weather in (.*)?",<br>        ["Weather in %1 is awesome like always","Too hot man here in %1","Too cold man here in %1","Never even heard about %1"]<br>    ],<br>    [<br>        r"i work in (.*)?",<br>        ["%1 is an Amazing company, I have heard about it. But they are in huge loss these days.",]<br>    ],<br>    [<br>        r"(.*)raining in (.*)",<br>        ["No rain since last week here in %2","Damn its raining too much here in %2"]<br>    ],<br>    [<br>        r"how (.*) health(.*)",<br>        ["I'm a computer program, so I'm always healthy ",]<br>    ],<br>    [<br>        r"(.*) (sports|game) ?",<br>        ["I'm a very big fan of Football and batminton",]<br>    ],<br>    [<br>        r"who (.*) sportsperson ?",<br>        ["Messy","Ronaldo","Roony","Neymar"]<br>    ],<br>    [<br>        r"who (.*) (moviestar|actor)?",<br>        ["our own Lal ettan"]<br>    ],<br>    [<br>        r"What (.*) time now",<br>        ["it's a good time for you, you are a lucky charm"]<br>    ],<br>    [<br>        r"quit",<br>        ["BBye take care. See you soon :) ","It was nice talking to you. See you soon :)"]<br>],<br>]<br><br>def Jarvis():<br>        print("Hi, I'm Jarvis and I chat alot ;)\nPlease type lowercase English language to start a conversation. Type quit to leave ") #default message at the start<br>        chat = Chat(pairs, reflections)<br>        chat.converse()<br>if __name__ == "__main__":<br>    Jarvis()<br><br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/91bc6cee4967d294ad0e381a78ba9ff5/download__1_.png" />
         <pubDate>2020-11-18 03:39:24 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934897857</guid>
      </item>
      <item>
         <title>Cholostrol</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934902247</link>
         <description><![CDATA[<div>LDL=eval(input("enter value of LDL:"))<br>HDL=eval(input("enter value of HDL:"))<br>TRI=eval(input("enter value of TRI:"))<br>total= LDL+HDL+ (TRI/5.0)<br>if (LDL&lt;100) and (HDL&gt;60) and (TRI,150) and (total&lt;200):<br>    print ("you gucci fam")<br>elif (LDL&gt;130) or (HDL&lt;50) or (TRI&gt;200) or (total&gt;240):<br>    print ("take serious action against your cholesterol fam!")<br>else:<br>    print("almost everyone has these problems, homeslice")<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/eaa0e9cde76f656b2534337113fd91cb/download__1_.jpeg" />
         <pubDate>2020-11-18 03:42:13 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934902247</guid>
      </item>
      <item>
         <title>Corona Drawing</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934904453</link>
         <description><![CDATA[<div>import turtle<br>t=turtle.Turtle()<br>s=turtle.Screen()<br>s.bgcolor('black')<br>t.pencolor('white')<br>a=0<br>b=0<br>t.speed(0)<br>t.penup()<br>t.goto(0,200)<br>t.pendown()<br>while True:<br>   t.forward(a)<br>   t.right(b)<br>   a+=3<br>   b+=1<br>   if b==210:<br>      break<br>   t.hideturtle()<br>turtle.done()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/73bab1c62bcb756452483d0a35c0cc97/Screenshot_2020_11_17_215119.jpg" />
         <pubDate>2020-11-18 03:43:31 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934904453</guid>
      </item>
      <item>
         <title>Upto-date Corona Virus Details</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934923871</link>
         <description><![CDATA[<div>from bs4 import BeautifulSoup as BS<br>import requests<br><br>def get_info(url):<br>   data=requests.get(url)<br>   soup=BS(data.text,'html.parser')<br>   total=soup.find("div",class_="maincounter-number").text<br>   total=total[1: len(total) - 2]<br>   other=soup.find_all("span",class_="number-table")<br>   recovered=other[2].text<br>   deaths=other[3].text<br>   deaths=deaths[1:]<br>   ans={'Total Cases':total,'Recovered Cases':recovered,'Total Deaths':deaths}<br>   return ans<br><br>url="https://www.worldometers.info/coronavirus/"<br>ans=get_info(url)<br>for i, j in ans.items():<br>   print(i + " : " + j)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/61c2b84a2a8d06fb82168df173b70239/download.jpeg" />
         <pubDate>2020-11-18 03:55:57 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934923871</guid>
      </item>
      <item>
         <title>Digital Clock</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934930353</link>
         <description><![CDATA[<div># importing whole module <br>from tkinter import * <br>from tkinter.ttk import *<br>  <br># importing strftime function to <br># retrieve system's time <br>from time import strftime <br>  <br># creating tkinter window <br>root = Tk() <br>root.title('Clock') <br>  <br># This function is used to  <br># display time on the label <br>def time(): <br>    string = strftime('%H:%M:%S %p') <br>    lbl.config(text = string) <br>    lbl.after(1000, time) <br>  <br># Styling the label widget so that clock <br># will look more attractive <br>lbl = Label(root, font = ('Castellar', 40, 'bold'), <br>            background = 'black', <br>            foreground = 'white') <br>  <br># Placing clock at the centre <br># of the tkinter window <br>lbl.pack(anchor = 'center') <br>time() <br>  <br>mainloop() <br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/586acd767bce186aab3c266e8b17cd88/images.png" />
         <pubDate>2020-11-18 03:59:51 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934930353</guid>
      </item>
      <item>
         <title>Flower Carpet(1)</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934936077</link>
         <description><![CDATA[<div>import turtle<br>turtle.bgcolor("black")<br>turtle.pensize(2)<br>turtle.speed(0)<br><br>for i in range(6):<br>   for colours in ['red','magenta','blue','cyan','green','yellow','white']:<br>      turtle.color(colours)<br>      turtle.circle(100)<br>      turtle.left(10)<br>turtle.hideturtle()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/fea3062d811a8c87d1a41c775fc7d541/atm.jpg" />
         <pubDate>2020-11-18 04:03:15 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934936077</guid>
      </item>
      <item>
         <title>Flower Carpet(2)</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934938162</link>
         <description><![CDATA[<div>import turtle<br>t=turtle.Turtle()<br>s=turtle.Screen()<br>s.bgcolor('white')<br>t.pencolor('red')<br>t.speed(1000)<br>c=0<br>d=0<br>while True:<br>   for i in range(4):<br>      t.forward(80)<br>      t.right(90)<br>   t.right(15)<br>   c+=1<br>   if c&gt;=390/15:<br>      t.forward(50)<br>      c=0<br>      d+=1<br>      if d&gt;12:<br>         break<br>t.hideturtle()<br>turtle.done()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/7981c42594ae4e4e33e73ee8edff1e6e/atm.jpg" />
         <pubDate>2020-11-18 04:04:28 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934938162</guid>
      </item>
      <item>
         <title>Flower Carpet(3)</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934950942</link>
         <description><![CDATA[<div>import turtle<br>my_wn=turtle.Screen()<br>turtle.speed(50)<br>for i in range(30):<br>    turtle.circle(5*i)<br>    turtle.circle(-5*i)<br>    turtle.left(i)<br>turtle.exitonclick()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/1530480c4be7064b181109d0e1500af1/atm.jpg" />
         <pubDate>2020-11-18 04:11:54 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934950942</guid>
      </item>
      <item>
         <title>Flower Carpet(4)</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934953527</link>
         <description><![CDATA[<div>import turtle<br>import math<br>import colorsys<br>phi=180*(3-math.sqrt(5))<br>t=turtle.Pen()<br>t.speed(0)<br>def square(t,size):<br>   for tmp in range(0,4):<br>      t.forward(size)<br>      t.right(90)<br><br>num=200<br>for x in reversed(range(0,num)):<br>   t.fillcolor(colorsys.hsv_to_rgb(x/num,1.0,1.0))<br>   t.begin_fill()<br>   t.circle(5+x,None,11)<br>   square(t,5+x)<br>   t.end_fill()<br>   t.right(phi)<br>   t.right(.8)<br>turtle.mainloop()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/8008ec8097332978d2d5ee786b5b1ca0/atm.jpg" />
         <pubDate>2020-11-18 04:13:20 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934953527</guid>
      </item>
      <item>
         <title>Password Strength Finder</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934963096</link>
         <description><![CDATA[<div>  <br>import re <br>   <br># Function to categorize password <br>def password(v): <br>   <br>    # the password should not be a <br>    # newline or space <br>    if v == "\n" or v == " ": <br>        return "Password cannot be a newline or space!"<br>   <br>    # the password length should be in <br>    # between 9 and 20 <br>    if 9 &lt;= len(v) &lt;= 20: <br>   <br>        # checks for occurrence of a character  <br>        # three or more times in a row <br>        if re.search(r'(.)\1\1', v): <br>            return "Weak Password: Same character repeats three or more times in a row"<br>   <br>        # checks for occurrence of same string  <br>        # pattern( minimum of two character length) <br>        # repeating <br>        if re.search(r'(..)(.*?)\1', v): <br>            return "Weak password: Same string pattern repetition"<br>   <br>        else: <br>            return "Strong Password!"<br>   <br>    else: <br>        return "Password length must be 9-20 characters!"<br>  <br># Main method <br>def main(): <br>   <br>    # Driver code <br>    print(password(input("enter a password:")))<br>    print(password(input("enter a password:")))<br>    print(password(input("enter a password:")))<br>   <br>   <br># Driver Code <br>if __name__ == '__main__': <br>    main() <br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/cbd7a22fe7e789ea7da2ee74ed685448/download__1_.png" />
         <pubDate>2020-11-18 04:18:34 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934963096</guid>
      </item>
      <item>
         <title>Gold Rate Value Upto-date</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934965123</link>
         <description><![CDATA[<div>from bs4 import BeautifulSoup as BS<br>import requests<br><br>def get_price(url):<br>   data=requests.get(url)<br>   soup=BS(data.text,'html.parser')<br>   ans=soup.find('div',id='current-price').text<br>   return ans<br>url='https://www.goodreturns.in/gold-rates/'<br>ans=get_price(url)<br>print(ans)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/903f3833fbe09908d4ddfcbf56fe0a44/download.jpeg" />
         <pubDate>2020-11-18 04:19:41 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934965123</guid>
      </item>
      <item>
         <title>Automatic Google Dino Game</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934970040</link>
         <description><![CDATA[<div># importing above defined libraries to <br>  # implement the functionalities  <br>from PIL import ImageGrab, ImageOps <br>import pyautogui <br>import time <br>import numpy as np   <br>     <br>class cordinates(): <br>  <br>    # coordinates of replay button to start the game <br>    replaybutton =(360, 214) <br>    # this coordinates represent the top-right coordinates <br>    # that will be used to define the front box <br>    dinasaur = (149, 239 ) <br>      <br>def restartGame(): <br>  <br>    # using pyautogui library, we are clicking on the  <br>    # replay button without any user interaction  <br>    pyautogui.click(cordinates.replaybutton) <br>  <br>    # we will keep our Bot always down that  <br>    # will prevent him to get hit by bird  <br>    pyautogui.keyDown('down') <br>  <br>def press_space(): <br>   <br>    # releasing the Down Key  <br>    pyautogui.keyUp('down')  <br>  <br>    # pressing Space to overcome Bush <br>    pyautogui.keyDown('space') <br>  <br>    # so that Space Key will be recognized easily <br>    time.sleep(0.05)  <br>  <br>    # printing the "Jump" statement on the <br>    # terminal to see the current output  <br>    print("jump") <br>    time.sleep(0.10) <br>  <br>    # releasing the Space Key  <br>    pyautogui.keyUp('space') <br>  <br>    # again pressing the Down Key to keep my Bot always down  <br>    pyautogui.keyDown('down') <br>  <br>def imageGrab():  <br>    # defining the coordinates of box in front of dinosaur  <br>    box = (cordinates.dinasaur[0]+30, cordinates.dinasaur[1], <br>           cordinates.dinasaur[0]+120, cordinates.dinasaur[1]+2) <br>  <br>    # grabbing all the pixels values in form of RGB tupples    <br>    image = ImageGrab.grab(box) <br>  <br>    # converting RGB to Grayscale to <br>    # make processing easy and result faster  <br>    grayImage = ImageOps.grayscale(image) <br>  <br>    # using numpy to get sum of all grayscale pixels  <br>    a = np.array(grayImage.getcolors()) <br>  <br>    # returning the sum <br>    print(a.sum())  <br>    return a.sum() <br>    <br>     <br>  <br># function to restart the game <br>restartGame() <br>while True:  <br>     # 435 is the sum of white pixels values of box.  <br>     # You may get different value is you are taking bigger  <br>     # or smaller box than the box taken in this article.  <br>     # if value returned by "imageGrab" function is not equal to 435,  <br>     # it means either bird or bush is coming towards dinosaur  <br>     if(imageGrab()!= 435):    <br>        press_space()   <br>        # time to recognize the operation performed by above function  <br>        time.sleep(0.1)    <br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/6b19de27b4ea5f6f25c83f633353b961/download.png" />
         <pubDate>2020-11-18 04:22:18 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934970040</guid>
      </item>
      <item>
         <title>Google Search in pyhton</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934974807</link>
         <description><![CDATA[<div>from googlesearch import *<br>import webbrowser<br>#to search, will ask search query at the time of execution<br>query = input("Input your query:")<br>#iexplorer_path = r'C:\Program Files (x86)\Internet Explorer\iexplore.exe %s'<br>chrome_path = r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %s'<br>for url in search(query, tld="co.in", num=1, stop = 1, pause = 2):<br>    webbrowser.open("https://google.com/search?q=%s" % query)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/ca12327ce3e0f85fe16626b3e039ef8d/download__2_.png" />
         <pubDate>2020-11-18 04:24:58 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934974807</guid>
      </item>
      <item>
         <title>Hash Code Finder</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934978071</link>
         <description><![CDATA[<div># Python rogram to find the SHA-1 message digest of a file<br><br># importing the hashlib module<br>import hashlib<br><br>def hash_file(filename):<br>   """"This function returns the SHA-1 hash<br>   of the file passed into it"""<br><br>   # make a hash object<br>   h = hashlib.sha1()<br><br>   # open file for reading in binary mode<br>   with open(filename,'rb') as file:<br><br>       # loop till the end of the file<br>       chunk = 0<br>       while chunk != b'':<br>           # read only 1024 bytes at a time<br>           chunk = file.read(1024)<br>           h.update(chunk)<br><br>   # return the hex representation of digest<br>   return h.hexdigest()<br><br>message = hash_file(input("enter the file:"))<br>print(message)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/e55c7a707217d72eace8af3162330b55/download__1_.jpeg" />
         <pubDate>2020-11-18 04:26:48 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/934978071</guid>
      </item>
      <item>
         <title>Illumination Rectangle</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935040183</link>
         <description><![CDATA[<div>""" <br> Recursively draw rectangles.<br> <br> Sample Python/Pygame Programs<br> Simpson College Computer Science<br> http://programarcadegames.com/<br> http://simpson.edu/computer-science/<br><br>"""<br>import pygame<br> <br># Define some colors<br>black    = (   0,   0,   0)<br>white    = ( 255, 255, 255)<br>green    = (   0, 255,   0)<br>red      = ( 255,   0,   0)<br> <br>def recursive_draw(x, y, width, height):<br>    """ Recursive rectangle function. """<br>    pygame.draw.rect(screen, black, <br>                     [x,y,width,height],<br>                     1)<br><br>    # Is the rectangle wide enough to draw again?<br>    if( width &gt; 14 ):<br>        # Scale down<br>        x += width * .1<br>        y += height * .1<br>        width *= .8<br>        height *= .8<br>        # Recursively draw again<br>        recursive_draw(x, y, width, height)<br>    <br>pygame.init()<br>  <br># Set the height and width of the screen<br>size = [700, 500]<br>screen = pygame.display.set_mode(size)<br> <br>pygame.display.set_caption("My Game")<br> <br>#Loop until the user clicks the close button.<br>done = False<br> <br># Used to manage how fast the screen updates<br>clock = pygame.time.Clock()<br> <br># -------- Main Program Loop -----------<br>while not done:<br>    for event in pygame.event.get(): # User did something<br>        if event.type == pygame.QUIT: # If user clicked close<br>            done = True # Flag that we are done so we exit this loop<br> <br>    # Set the screen background<br>    screen.fill(white)<br> <br>    # ALL CODE TO DRAW SHOULD GO BELOW THIS COMMENT<br>    recursive_draw(0, 0, 700, 500)<br>    # ALL CODE TO DRAW SHOULD GO ABOVE THIS COMMENT<br>     <br>    # Go ahead and update the screen with what we've drawn.<br>    pygame.display.flip()<br><br>    # Limit to 60 frames per second<br>    clock.tick(60)<br>     <br># Be IDLE friendly. If you forget this line, the program will 'hang'<br># on exit.<br>pygame.quit()</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/d44db3c648cefe03a19129e97bf2dfca/illuminate.jpg" />
         <pubDate>2020-11-18 05:00:17 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935040183</guid>
      </item>
      <item>
         <title>Insta Profile Downloader</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935047577</link>
         <description><![CDATA[<div>import instaloader<br>mod=instaloader.Instaloader()<br>a=input('Enter the User Name --&gt;')<br>mod.download_profile(a,profile_pic_only=True)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/aef09d6e5b9dabf31189e613f6f6f0d8/download__2_.jpeg" />
         <pubDate>2020-11-18 05:04:19 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935047577</guid>
      </item>
      <item>
         <title>Internet Speed</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935057365</link>
         <description><![CDATA[<div>import speedtest<br>test=speedtest.Speedtest()<br>down=test.download()<br>upload=test.upload()<br>print(f"Download speed:{down}")<br>print(f"Upload speed:{upload}")</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/0b0c24a1b4799651a4b44d7a29ef08a6/images.jpeg" />
         <pubDate>2020-11-18 05:09:29 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935057365</guid>
      </item>
      <item>
         <title>Loan Calculator</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935068067</link>
         <description><![CDATA[<div>from tkinter import *<br><br>#Import Tk themed widgets<br>from tkinter import ttk<br><br>class Loan_Calculator():<br><br>    def __init__(self):<br>         <br>        #creating the root window here<br>        root = Tk()<br><br>        #set the title <br>        root.title('Loan Calculator')<br><br>        #set the geometry<br>        #root.geometry('250x300')<br><br>        #set the background color<br>        root.config(background='beige')<br><br>        #creating the labels<br>        Label(root,text='Annual Interest Rate',bg='Beige' , borderwidth = 4).grid(row=1,column = 1,sticky = W)<br><br>        Label(root,text='Numbers of Years',bg='Beige' , borderwidth = 4).grid(row=2,column = 1,sticky = W)<br><br>        Label(root,text='Loan Ammount',bg='Beige' , borderwidth = 4).grid(row=3,column = 1,sticky = W)<br><br>        Label(root,text='Monthly Payment',bg='Beige' , borderwidth = 4).grid(row=4 ,column = 1,sticky = W)<br><br>        Label(root,text='Total Payment',bg='Beige' , borderwidth = 4).grid(row=5,column = 1,sticky = W)<br><br>        #Create the Entry Widgets<br>        self.AnnualInterest = StringVar()<br>        Entry(root, textvariable = self.AnnualInterest,justify = RIGHT).grid(row = 1,column = 2,sticky = E)<br><br>        self.years = StringVar()<br>        Entry(root, textvariable = self.years,justify = RIGHT).grid(row = 2,column = 2,sticky = E)<br><br>        self.amount = StringVar()<br>        Entry(root, textvariable = self.amount,justify = RIGHT).grid(row = 3,column = 2,sticky = E)<br><br>        self.monthlyPayment = StringVar()<br>        Label(root, textvariable = self.monthlyPayment).grid(row = 4,column = 2,sticky = E)<br><br>        self.TotalPayment = StringVar()<br>        Label(root, textvariable = self.TotalPayment).grid(row = 5,column = 2,sticky = E)<br><br>        #CREATING BUTTONS<br>        compute = Button(root, text = 'Compute Loan',command = self.ComputePayment).grid(row = 6, column = 2,sticky = E)<br><br>        root.mainloop()<br><br>    # compute the total payment. <br>    def ComputePayment(self): <br>                  <br>        month = self.getMonthlyPayment( <br>        float(self.amount.get()), <br>        float(self.AnnualInterest.get()) / 1200, <br>        int(self.years.get())) <br>  <br>        self.monthlyPayment.set(format(month, '10.2f')) <br><br>        total = float(self.monthlyPayment.get()) * 12 * int(self.years.get()) <br>  <br>        self.TotalPayment.set(format(total, '10.2f')) <br>  <br>    def getMonthlyPayment(self, loanAmount, monthlyInterestRate, numberOfYears):  <br>        # compute the monthly payment. <br>        month = loanAmount * monthlyInterestRate / (1<br>        - 1 / (1 + monthlyInterestRate) ** (numberOfYears * 12)) <br>        return month; <br><br>Loan_Calculator()</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/42f90a591509fec1ff6a7ee598af7c42/download.jpeg" />
         <pubDate>2020-11-18 05:15:10 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935068067</guid>
      </item>
      <item>
         <title>Python Love</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935079652</link>
         <description><![CDATA[<div>import turtle<br><br>turtle.bgcolor("white")<br>turtle.pensize(2)<br><br>def curve():<br>   for i in range(200):<br>      turtle.right(1)<br>      turtle.forward(1)<br><br>turtle.speed(0)<br>turtle.color("pink","pink")<br><br>turtle.begin_fill()<br>turtle.left(140)<br>turtle.forward(111.65)<br>curve()<br><br>turtle.left(120)<br>curve()<br>turtle.forward(111.65)<br>turtle.end_fill()<br>turtle.hideturtle()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/09ba9e1f08b9882787f21aa3118b569c/download__2_.jpeg" />
         <pubDate>2020-11-18 05:21:24 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935079652</guid>
      </item>
      <item>
         <title>Morce Code Converter</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935157960</link>
         <description><![CDATA[<div># Python program to implement Morse Code Translator <br>  <br>''' <br>VARIABLE KEY <br>'cipher' -&gt; 'stores the morse translated form of the english string' <br>'decipher' -&gt; 'stores the english translated form of the morse string' <br>'citext' -&gt; 'stores morse code of a single character' <br>'i' -&gt; 'keeps count of the spaces between morse characters' <br>'message' -&gt; 'stores the string to be encoded or decoded' <br>'''<br>  <br># Dictionary representing the morse code chart <br>MORSE_CODE_DICT = { 'A':'.-', 'B':'-...', <br>                    'C':'-.-.', 'D':'-..', 'E':'.', <br>                    'F':'..-.', 'G':'--.', 'H':'....', <br>                    'I':'..', 'J':'.---', 'K':'-.-', <br>                    'L':'.-..', 'M':'--', 'N':'-.', <br>                    'O':'---', 'P':'.--.', 'Q':'--.-', <br>                    'R':'.-.', 'S':'...', 'T':'-', <br>                    'U':'..-', 'V':'...-', 'W':'.--', <br>                    'X':'-..-', 'Y':'-.--', 'Z':'--..', <br>                    '1':'.----', '2':'..---', '3':'...--', <br>                    '4':'....-', '5':'.....', '6':'-....', <br>                    '7':'--...', '8':'---..', '9':'----.', <br>                    '0':'-----', ', ':'--..--', '.':'.-.-.-', <br>                    '?':'..--..', '/':'-..-.', '-':'-....-', <br>                    '(':'-.--.', ')':'-.--.-'} <br>  <br># Function to encrypt the string <br># according to the morse code chart <br>def encrypt(message): <br>    cipher = '' <br>    for letter in message: <br>        if letter != ' ': <br>  <br>            # Looks up the dictionary and adds the <br>            # correspponding morse code <br>            # along with a space to separate <br>            # morse codes for different characters <br>            cipher += MORSE_CODE_DICT[letter] + ' '<br>        else: <br>            # 1 space indicates different characters <br>            # and 2 indicates different words <br>            cipher += ' '<br>  <br>    return cipher <br>  <br># Function to decrypt the string <br># from morse to english <br>def decrypt(message): <br>  <br>    # extra space added at the end to access the <br>    # last morse code <br>    message += ' '<br>  <br>    decipher = '' <br>    citext = '' <br>    for letter in message: <br>  <br>        # checks for space <br>        if (letter != ' '): <br>  <br>            # counter to keep track of space <br>            i = 0<br>  <br>            # storing morse code of a single character <br>            citext += letter <br>  <br>        # in case of space <br>        else: <br>            # if i = 1 that indicates a new character <br>            i += 1<br>  <br>            # if i = 2 that indicates a new word <br>            if i == 2 : <br>  <br>                 # adding space to separate words <br>                decipher += ' '<br>            else: <br>  <br>                # accessing the keys using their values (reverse of encryption) <br>                decipher += list(MORSE_CODE_DICT.keys())[list(MORSE_CODE_DICT <br>                .values()).index(citext)] <br>                citext = '' <br>  <br>    return decipher<br># Hard-coded driver function to run the program <br>def main(): <br>    message = input("enter the string:")<br>    result = encrypt(message.upper()) <br>    print (result) <br>  <br>    message = "--. . . -.- ... -....- ..-. --- .-. -....- --. . . -.- ... "<br>    result = decrypt(message) <br>    '''print (result) '''<br>  <br># Executes the main function <br>if __name__ == '__main__':<br>    main()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/cddd8bf0986149038f3019240b4fc3f1/download.jpeg" />
         <pubDate>2020-11-18 06:02:03 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935157960</guid>
      </item>
      <item>
         <title>Phone Number Details</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935165159</link>
         <description><![CDATA[<div>import phonenumbers<br>from phonenumbers import carrier<br>from phonenumbers import geocoder<br>phone_number=phonenumbers.parse("+919495567349")<br>print(geocoder.description_for_number(phone_number,'en'))<br>print(carrier.name_for_number(phone_number,'en'))<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/5d6af9bc12e3a3120b9aac989cd5d93d/images.jpeg" />
         <pubDate>2020-11-18 06:05:18 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935165159</guid>
      </item>
      <item>
         <title>Progress Bar</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935192928</link>
         <description><![CDATA[<div>from tqdm import tqdm<br>import time<br><br>for i in tqdm(range(101),<br>              desc="Loading........",<br>              ascii=False, ncols=75):<br>   time.sleep(0.01)<br>print('You are Hacked!!!!!' )<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/121719e1ea33fd57f435d0977d6114fa/images__1_.jpeg" />
         <pubDate>2020-11-18 06:15:23 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935192928</guid>
      </item>
      <item>
         <title>PyCalculator</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935206021</link>
         <description><![CDATA[<div># pyCalc<br># Version 1.1<br><br># Handle Imports<br>from tkinter import *<br>from tkinter import ttk<br><br># Define Calculator Class<br><br><br>class Calculator:<br><br>	# Track calculator values<br>	calc_value = 0.0<br><br>	# Track Mathematical operators<br>	div_trigger = False<br>	mult_trigger = False<br>	add_trigger = False<br>	sub_trigger = False<br><br>	# Function - Add up numbers in Entry<br>	def button_press(self, value):<br>		entry_val = self.number_entry.get()<br>		if value != "AC":<br>			entry_val += value<br>			self.number_entry.delete(0, "end")<br>			self.number_entry.insert(0, entry_val)<br>		else:<br>			entry_val = ""<br>			self.number_entry.delete(0, "end")<br>			self.number_entry.insert(0, entry_val)<br><br>	# Function - Check if value is a float<br>	def isfloat(self, str_val):<br>			try:<br>					float(str_val)<br>					return True<br>			except ValueError:<br>					return False<br><br>	# Function - Perform mathematical operations<br>	def math_button_press(self, value):<br>			if self.isfloat(str(self.number_entry.get())):<br>					self.div_trigger = False<br>					self.mult_trigger = False<br>					self.add_trigger = False<br>					self.sub_trigger = False<br><br>					self.calc_value = float(self.entry_value.get())<br>					if value == "/":<br>							self.div_trigger = True<br>					elif value == "*":<br>							self.mult_trigger = True<br>					elif value == "+":<br>							self.add_trigger = True<br>					else:<br>							self.sub_trigger = True<br><br>					self.number_entry.delete(0, "end")<br><br>	# Function - Display results to Entry<br>	def equal_button_press(self):<br>			if self.div_trigger or self.mult_trigger or self.add_trigger or self.sub_trigger:<br>					if self.add_trigger:<br>							solution = self.calc_value + float(self.entry_value.get())<br>					elif self.sub_trigger:<br>							solution = self.calc_value - float(self.entry_value.get())<br>					elif self.mult_trigger:<br>							solution = self.calc_value * float(self.entry_value.get())<br>					else:<br>							solution = self.calc_value / float(self.entry_value.get())<br>					self.number_entry.delete(0, "end")<br>					self.number_entry.insert(0, solution)<br><br>    # Create Tkinter Interface<br>	def __init__(self, root):<br>			self.entry_value = StringVar(root, value="")<br>			root.title('pyCalc')<br>			root.geometry("580x330")<br>			root.resizable(width=False, height=False)<br><br>			# Tkinter Styling<br>			style = ttk.Style()<br>			style.configure("TButton", font="Serif 15", padding=10)<br>			style.configure("TEntry", font="Serif 18", padding=10)<br><br>			# Setup GUI<br>			self.number_entry = ttk.Entry(<br>					root, textvariable=self.entry_value, width=50)<br>			self.number_entry.grid(row=0, columnspan=4)<br><br>			# Buttons - Row 1<br>			self.button7 = ttk.Button(root, text="7",<br>																command=lambda: self.button_press("7")).grid(row=1, column=0)<br><br>			self.button8 = ttk.Button(root, text="8",<br>																command=lambda: self.button_press("8")).grid(row=1, column=1)<br><br>			self.button9 = ttk.Button(root, text="9",<br>																command=lambda: self.button_press("9")).grid(row=1, column=2)<br><br>			self.button_division = ttk.Button(root, text="/",<br>																				command=lambda: self.math_button_press("/")).grid(row=1, column=3)<br><br>							# Buttons - Row 2<br>			self.button4 = ttk.Button(root, text="4",<br>																command=lambda: self.button_press("4")).grid(row=2, column=0)<br><br>			self.button5 = ttk.Button(root, text="5",<br>																command=lambda: self.button_press("5")).grid(row=2, column=1)<br><br>			self.button6 = ttk.Button(root, text="6",<br>																command=lambda: self.button_press("6")).grid(row=2, column=2)<br><br>			self.button_multiply = ttk.Button(root, text="*",<br>																				command=lambda: self.math_button_press("*")).grid(row=2, column=3)<br><br>							# Buttons - Row 3<br>			self.button1 = ttk.Button(root, text="1",<br>																command=lambda: self.button_press("1")).grid(row=3, column=0)<br><br>			self.button2 = ttk.Button(root, text="2",<br>																command=lambda: self.button_press("2")).grid(row=3, column=1)<br><br>			self.button3 = ttk.Button(root, text="3",<br>																command=lambda: self.button_press("3")).grid(row=3, column=2)<br><br>			self.button_add = ttk.Button(root, text="+",<br>																		command=lambda: self.math_button_press("+")).grid(row=3, column=3)<br><br>							# Buttons - Row 4<br>			self.button_clear = ttk.Button(root, text="AC",<br>																			command=lambda: self.button_press("AC")).grid(row=4, column=0)<br><br>			self.button0 = ttk.Button(root, text="0",<br>																command=lambda: self.button_press("0")).grid(row=4, column=1)<br><br>			self.button_equal = ttk.Button(root, text="=",<br>																			command=lambda: self.equal_button_press()).grid(row=4, column=2)<br><br>			self.button_sub = ttk.Button(root, text="-",<br>																		command=lambda: self.math_button_press("-")).grid(row=4, column=3)<br><br><br># Run application<br>root = Tk()<br>calc = Calculator(root)<br>root.mainloop()</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/0c2d3359a01384694e77b956cea5a572/images.jpeg" />
         <pubDate>2020-11-18 06:20:26 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935206021</guid>
      </item>
      <item>
         <title>Python Dictionary</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935211399</link>
         <description><![CDATA[<div>from PyDictionary import PyDictionary<br>dict=PyDictionary()<br>meaning = dict.meaning(input("enter the word to be searched:"))<br>print(meaning)</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/09d8fb7d86077d381b83e96e291fada7/images__1_.jpeg" />
         <pubDate>2020-11-18 06:22:32 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935211399</guid>
      </item>
      <item>
         <title>Random Password Generator</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935244095</link>
         <description><![CDATA[<div>import random<br>import string<br>def get_random_password_string(length):<br>   password_character=string.ascii_letters+string.digits+string.punctuation<br>   password=' '.join(random.choice(password_character) for i in range(length))<br>   print("Your Password is:",password)<br>get_random_password_string(int(input("enter how many characters:")))<br>   <br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/659f1b5b23d2369a468c62f3cf71db41/download.png" />
         <pubDate>2020-11-18 06:35:02 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935244095</guid>
      </item>
      <item>
         <title>Simple ATM</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935256196</link>
         <description><![CDATA[<div>def main():<br>    pinCode = ["1234", "1999", "2424", "1985", "5555","1621"] #data of the account holders<br>    accountHoldersName = ["harry den", "zain ul abideen", "waseema shaukat", "ayesha mukhtar", "khalid mahmood",]<br>    accountNumber = ['1353', '199281', "182838", "185597", "667432",<br>    balance = [567000, 21873, 2341871, 275638, 91820,14562396876]<br><br>    flag = False<br>    for i in range (0,999999999): #so the loop runs almost infinit many times<br>        print("""<br>    \t\t=== Welcome To Simple ATM System ===<br>""")<br>        inputName = input("Enter Your Name: ")<br>        inputName = inputName.lower()<br>        inputPin = 0000 #if pin is wrong it will be use as this is assigned before referance.<br>        index = 0 #if pin is wrong it will be use as this is assigned before referance.<br>        for name in accountHoldersName:<br>            count = 0<br>            if name == inputName:<br>                index = count #index of anme is stored and if the pin of that index is same user will be given access to the account.<br>                inputPin = input("\nEnter Pin Number: ")<br>            count += 1<br><br>        if inputPin == pinCode[index]:<br>            flag = True<br>        else:<br>            print("Invalid data.")<br>            flag = False<br>            continue<br>        if flag == True:<br>            print("\nYour account number is: ",accountNumber[index])<br>            print("Your account balance is: Rs.", balance[index])<br>            drawOrDeposite = input("\nDo you want to draw or deposit cash (draw/deposite/no): ")<br>            if drawOrDeposite == "draw":<br>                amount = input("\nEnter the amount you want to draw: ")<br>                try: #Exception handling<br>                    amount = int(amount)<br>                    if amount &gt; balance[index]:<br>                        raise<br>                except:<br>                    print("invalid amount.")<br>                    continue<br>                remainingBalalnce = balance[index] - amount #subtracting the drawed amount.<br>                balance.remove(balance[index]) #removing the old ammount from the list and adding the new list after draw.<br>                balance.insert(index,remainingBalalnce)<br>                availableBalance = print("\nYour available balance is: ",remainingBalalnce)<br>            elif drawOrDeposite == "deposite":<br>                amount = input("Enter the amount you want to deposite: ")<br>                try:<br>                    amount = int(amount)<br>                    if amount &gt; balance[index]:<br>                        raise<br>                except:<br>                    print("invalid amount.")<br>                    continue<br>                remainingBalalnce = balance[index] + amount #adding the deposited amount.<br>                balance.remove(balance[index])#removing the old ammount from the list and adding the new list after draw.<br>                balance.insert(index,remainingBalalnce)<br>                availableBalance = print("Your available balance is: ",remainingBalalnce)<br>            print("\n\nThank you for using this Simple ATM System. \n  Brought To You By code-projects.org")<br><br>main()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/5f509c5f3b79b481c9ee009110ca7a17/images.png" />
         <pubDate>2020-11-18 06:39:33 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935256196</guid>
      </item>
      <item>
         <title>Stop Watch</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935273115</link>
         <description><![CDATA[<div>import time<br>print("Press ENTER to start the stopwatch")<br>print("and , Press CTRL+C to stop the stopwatch")<br>while True:<br>   try:<br>      input()<br>      start_time=time.time()<br>      print("stopwatch started..........!!!!!!!!!!!!!!!")<br>   except KeyboardInterrupt:<br>      print("Stopwatch stopped........!!!!!!!!!!!!!")<br>      end_time=time.time()<br>      print("The Total Time:",round(end_time - start_time,2),"seconds")<br>      break<br><br>   <br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/60a5133df953cbe0a68f49b84bd7ee19/images__1_.png" />
         <pubDate>2020-11-18 06:45:55 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935273115</guid>
      </item>
      <item>
         <title>Timer</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935279098</link>
         <description><![CDATA[<div>""" <br> Show how to put a timeer on the screen.<br> <br> Sample Python/Pygame Programs<br> Simpson College Computer Science<br> http://programarcadegames.com/<br> http://simpson.edu/computer-science/<br><br>"""<br> <br>import pygame<br> <br># Define some colors<br>black    = (   0,   0,   0)<br>white    = ( 255, 255, 255)<br>green    = (   0, 255,   0)<br>red      = ( 255,   0,   0)<br> <br>pygame.init()<br>  <br># Set the height and width of the screen<br>size = [700, 500]<br>screen = pygame.display.set_mode(size)<br> <br>pygame.display.set_caption("My Game")<br> <br>#Loop until the user clicks the close button.<br>done = False<br> <br># Used to manage how fast the screen updates<br>clock = pygame.time.Clock()<br><br>font = pygame.font.Font(None, 25)<br><br>frame_count = 0<br>frame_rate = 60<br>start_time = 90<br><br># -------- Main Program Loop -----------<br>while not done:<br>    for event in pygame.event.get(): # User did something<br>        if event.type == pygame.QUIT: # If user clicked close<br>            done = True # Flag that we are done so we exit this loop<br> <br>    # Set the screen background<br>    screen.fill(white)<br> <br>    # ALL CODE TO DRAW SHOULD GO BELOW THIS COMMENT<br>    <br>    # --- Timer going up ---<br>    # Calculate total seconds<br>    total_seconds = frame_count // frame_rate<br>    <br>    # Divide by 60 to get total minutes<br>    minutes = total_seconds // 60<br>    <br>    # Use modulus (remainder) to get seconds<br>    seconds = total_seconds % 60<br>    <br>    # Use python string formatting to format in leading zeros<br>    output_string = "Time: {0:02}:{1:02}".format(minutes, seconds)<br>    <br>    # Blit to the screen<br>    text = font.render(output_string, True, black)<br>    screen.blit(text, [250, 250])<br>    <br><br>    # --- Timer going down ---<br>    # --- Timer going up ---<br>    # Calculate total seconds<br>    total_seconds = start_time - (frame_count // frame_rate)<br>    if total_seconds &lt; 0:<br>        total_seconds = 0<br>    <br>    # Divide by 60 to get total minutes<br>    minutes = total_seconds // 60<br>    <br>    # Use modulus (remainder) to get seconds<br>    seconds = total_seconds % 60<br>    <br>    # Use python string formatting to format in leading zeros<br>    output_string = "Time left: {0:02}:{1:02}".format(minutes, seconds)<br>    <br>    # Blit to the screen<br>    text = font.render(output_string, True, black)<br>    <br>    screen.blit(text, [250, 280])<br>    <br>    # ALL CODE TO DRAW SHOULD GO ABOVE THIS COMMENT<br>    frame_count += 1<br>    # Limit to 20 frames per second<br>    clock.tick(frame_rate)<br> <br>    # Go ahead and update the screen with what we've drawn.<br>    pygame.display.flip()<br>     <br># Be IDLE friendly. If you forget this line, the program will 'hang'<br># on exit.<br>pygame.quit ()</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/c0de41ebd903955d9f608521ac0f71d8/images__2_.png" />
         <pubDate>2020-11-18 06:47:58 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935279098</guid>
      </item>
      <item>
         <title>Traslator</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935294323</link>
         <description><![CDATA[<div>from translate import Translator<br>translator= Translator(from_lang=input("enter  your language:"),to_lang=input("which language do you want to translate:"))<br>translation = translator.translate(input("enter the word or sentence:"))<br>print( translation)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/d3ca1f7acf5fc42252adcf7fbdf0451c/images__3_.png" />
         <pubDate>2020-11-18 06:52:37 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935294323</guid>
      </item>
      <item>
         <title>Video to Audio Converter</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935298304</link>
         <description><![CDATA[<div>'''import moviepy.editor<br>video=moviepy.editor.VideoFileClip("war.mp4")<br>audio=video.audio<br>audio.write_audiofile("reasult.mp3")<br>'''<br>import moviepy.editor as mp <br><br># Insert Local Video File Path <br>clip = mp.VideoFileClip(r"WAR.mp4") <br><br># Insert Local Audio File Path <br>clip.audio.write_audiofile(r"reasult.mp3") <br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/76060e0e47383093a452a161b5e5439e/images.jpeg" />
         <pubDate>2020-11-18 06:53:55 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935298304</guid>
      </item>
      <item>
         <title>Wikipedia Prototype</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935302346</link>
         <description><![CDATA[<div># importing the module <br>import wikipedia <br>  <br># setting language to hindi <br>wikipedia.set_lang("en") <br>  <br># printing the summary <br>print(wikipedia.summary(input("enter what to search:")))<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/450591b6a6eb471bb6e3c99df2c898c1/download.jpeg" />
         <pubDate>2020-11-18 06:55:11 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935302346</guid>
      </item>
      <item>
         <title>Windows Pattern with Pyhton</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935305814</link>
         <description><![CDATA[<div>def windows(n):<br>   if n%2!=0:<br>      c=(n//2)+1<br>      d=0<br>   else:<br>      c=c=(n//2)+1<br>      d=c=(n//2)<br>   for i in range( 1, n+1):<br>      for j in range(1, n+1):<br>         if i==1 or j==1 or i==n or j==n:<br>            print('*',end= " ")<br>         else:<br>            if i==c or j==c:<br>               print('*',end= " ")<br>            elif i==d or j==d:<br>               print('*',end= " ")<br>            else:<br>               print(" ",end=" ")<br>      print()<br>if __name__=="__main__":<br>   n=7<br>   windows(n)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/185f0b2b69ac071f7019ce8429ef705f/download.png" />
         <pubDate>2020-11-18 06:56:17 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935305814</guid>
      </item>
      <item>
         <title>Youtube Downloader</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935308966</link>
         <description><![CDATA[<div>from __future__ import unicode_literals<br>import youtube_dl<br>import urllib<br>import shutil<br>ydl_opts = {}<br>with youtube_dl.YoutubeDL(ydl_opts) as ydl:<br>    ydl.download(['https://www.youtube.com/watch?v=n06H7OcPd-g'])<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/88caaa3000cfecfe9b2bccbfc445177f/download.jpeg" />
         <pubDate>2020-11-18 06:57:08 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935308966</guid>
      </item>
      <item>
         <title>Youtube Video to Audio</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935316628</link>
         <description><![CDATA[<div>import pafy  <br>  <br>url = input("enter the youtube url to convert mp3:")<br>video = pafy.new(url) <br>  <br>bestaudio = video.getbestaudio() <br>bestaudio.download() <br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/3724be6b9a58ecbbe546bec0f6a21e51/download.jpeg" />
         <pubDate>2020-11-18 06:59:37 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935316628</guid>
      </item>
      <item>
         <title>Adventure Text Game</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935837652</link>
         <description><![CDATA[<div>yes_no = ["yes", "no"]<br>directions = ["left", "right", "forward", "backward"]<br> <br># Introduction<br>name = input("What is your name, adventurer?\n")<br>print("Greetings, " + name + ". Let us go on a quest!")<br>print("You find yourself on the edge of a dark forest.")<br>print("Can you find your way through?\n")<br> <br># Start of game<br>response = ""<br>while response not in yes_no:<br>    response = input("Would you like to step into the forest?\nyes/no\n")<br>    if response == "yes":<br>        print("You head into the forest. You hear crows cawwing in the distance.\n")<br>    elif response == "no":<br>        print("You are not ready for this quest. Goodbye, " + name + ".")<br>        quit()<br>    else: <br>        print("I didn't understand that.\n")<br> <br># Next part of game<br>response = ""<br>while response not in directions:<br>    print("To your left, you see a bear.")<br>    print("To your right, there is more forest.")<br>    print("There is a rock wall directly in front of you.")<br>    print("Behind you is the forest exit.\n")<br>    response = input("What direction do you move?\nleft/right/forward/backward\n")<br>    if response == "left":<br>        print("The bear eats you. Farewell, " + name + ".")<br>        quit()<br>    elif response == "right":<br>        print("You head deeper into the forest.\n")<br>    elif response == "forward":<br>        print("You cannot scale the wall.\n")<br>        response = "" <br>    elif response == "backward":<br>        print("You leave the forest. Goodbye, " + name + ".")<br>        quit()<br>    else:<br>        print("I didn't understand that.\n")</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/8447d51d6b022d9e50427d386d872ef1/a.png" />
         <pubDate>2020-11-18 09:47:43 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935837652</guid>
      </item>
      <item>
         <title>Air Hockey</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935846355</link>
         <description><![CDATA[<div># -*- coding: utf-8 -*-<br>""" Air Hockey """<br><br>import sys, random<br><br>if sys.version_info.major &gt; 2:<br>    import tkinter as tk<br>else:<br>    import Tkinter as tk<br><br>RED, BLACK, WHITE, DARK_RED, BLUE = "red", "black", "white", "dark red", "blue"<br>ZERO = 2 #for edges.<br>LOWER, UPPER = "lower", "upper"<br>HOME, AWAY = "Top", "Bottom"<br>#Should ALWAYS make a copy of START_SCORE before using it - START_SCORE.copy().<br>START_SCORE = {HOME: 0, AWAY: 0}<br>MAX_SCORE = 7 #Winning score.<br>SPEED = 20 #milliseconds between frame update.<br>FONT = "ms 50"<br>MAX_SPEED, PADDLE_SPEED = 15, 15<br><br>#### METHODS ####<br><br>def str_dict(dic):<br>    """ Returns a string version of score dictionary - dic """<br>    return "%s: %d, %s: %d" % (HOME, dic[HOME], AWAY, dic[AWAY])<br>    <br>def rand():<br>    """<br>    Picks a random tuple to return out of:<br>    (1, 1), (1, -1), (-1, 1), (-1, -1)<br>    """<br>    return random.choice(((1, 1), (1, -1), (-1, 1), (-1, -1))) <br>    <br>#### OBJECT DEFINITIONS ####<br>        <br>class Equitment(object):<br>    """<br>    Parent class of Puck and Paddle.<br>    canvas: tk.Canvas object.<br>    width: int, radius of object.<br>    position: tuple, initial position (x, y).<br>    color: string, color of object.<br>    """<br>    def __init__(self, canvas, width, position, color):<br>        self.can, self.w = canvas, width<br>        self.x, self.y = position<br>        <br>        self.Object = self.can.create_oval(self.x-self.w, self.y-self.w, <br>                                    self.x+self.w, self.y+self.w, fill=color)<br>    def update(self, position):<br>        self.x, self.y = position<br>        self.can.coords(self.Object, self.x-self.w, self.y-self.w,<br>                                     self.x+self.w, self.y+self.w)<br>    def __eq__(self, other):<br>        overlapping = self.can.find_overlapping(self.x-self.w, self.y-self.w,<br>                                                self.x+self.w, self.y+self.w)<br>        return other.get_object() in overlapping<br>        <br>    def get_width(self):<br>        return self.w<br>    def get_position(self):<br>        return self.x, self.y<br>    def get_object(self):<br>        return self.Object<br>        <br>class PuckManager(Equitment):<br>    """<br>    A black instance of Equitment.<br>    canvas: tk.Canvas object.<br>    width: int, radius of puck.<br>    position: tuple, initial position (x, y).<br>    """<br>    def __init__(self, canvas, width, position):<br>        Equitment.__init__(self, canvas, width, position, BLACK)<br>        <br>class Paddle(Equitment):<br>    """<br>    A red instance of Equitment with an extra drawing (handle).<br>    canvas: tk.Canvas object.<br>    width: int, radius of paddle.<br>    position: tuple, initial position (x, y).<br>    """  <br>    def __init__(self, canvas, width, position):<br>        Equitment.__init__(self, canvas, width, position, RED)<br>        self.handle = self.can.create_oval(self.x-self.w/2, self.y-self.w/2,<br>                                self.x+self.w/2, self.y+self.w/2, fill=DARK_RED)<br>    def update(self, position):<br>        Equitment.update(self, position)<br>        self.can.coords(self.handle, self.x-self.w/2, self.y-self.w/2,<br>                                   self.x+self.w/2, self.y+self.w/2)<br>                                   <br>class Background(object):<br>    """<br>    canvas: tk.Canvas object.<br>    screen: tuple, screen size (w, h).<br>    goal_w: int, width of the goal.<br>    """<br>    def __init__(self, canvas, screen, goal_w):<br>        self.can, self.goal_w = canvas, goal_w     <br>        self.w, self.h = screen<br>        <br>        self.draw_bg()<br>    <br>    def draw_bg(self):<br>        self.can.config(bg=WHITE, width=self.w, height=self.h)<br>        #middle circle<br>        d = self.goal_w/4<br>        self.can.create_oval(self.w/2-d, self.h/2-d, self.w/2+d, self.h/2+d, <br>                                                     fill=WHITE, outline=BLUE)<br>        self.can.create_line(ZERO, self.h/2, self.w, self.h/2, fill=BLUE)#middle<br>        self.can.create_line(ZERO, ZERO, ZERO, self.h, fill=BLUE) #left<br>        self.can.create_line(self.w, ZERO, self.w, self.h, fill=BLUE) #right<br>        #top<br>        self.can.create_line(ZERO, ZERO, self.w/2-self.goal_w/2, ZERO, <br>                                                                     fill=BLUE)<br>        self.can.create_line(self.w/2+self.goal_w/2, ZERO, self.w, ZERO, <br>                                                                     fill=BLUE)<br>        #bottom<br>        self.can.create_line(ZERO, self.h, self.w/2-self.goal_w/2, self.h, <br>                                                                     fill=BLUE)<br>        self.can.create_line(self.w/2+self.goal_w/2, self.h, self.w, self.h, <br>                                                                     fill=BLUE)<br>                                                                     <br>    def is_position_valid(self, position, width, constraint=None):<br>        x, y = position<br>        #if puck is in goal, let it keep going in.<br>        if constraint == None and self.is_in_goal(position, width):<br>            return True<br>        elif (x - width &lt; ZERO or x + width &gt; self.w or <br>            y - width &lt; ZERO or y + width &gt; self.h):<br>            return False<br>        elif constraint == LOWER:<br>            return y - width &gt; self.h/2<br>        elif constraint == UPPER:<br>            return y + width &lt; self.h/2<br>        else:<br>            return True    <br><br>    def is_in_goal(self, position, width):<br>        x, y = position<br>        if (y - width &lt;= ZERO and x - width &gt; self.w/2 - self.goal_w/2 and <br>                                    x + width &lt; self.w/2 + self.goal_w/2):<br>            return HOME<br>        elif (y + width &gt;= self.h and x - width &gt; self.w/2 - self.goal_w/2 and <br>                                        x + width &lt; self.w/2 + self.goal_w/2):<br>            return AWAY<br>        else:<br>            return False<br>            <br>    def get_screen(self):<br>        return self.w, self.h   <br>    def get_goal_w(self):<br>        return self.goal_w<br>        <br>class Puck(object):<br>    """<br>    canvas: tk.Canvas object.<br>    background: Background object.<br>    """<br>    def __init__(self, canvas, background):<br>        self.background = background<br>        self.screen = self.background.get_screen()<br>        self.x, self.y = self.screen[0]/2, self.screen[1]/2<br>        self.can, self.w = canvas, self.background.get_goal_w()/12<br>        c, d = rand() #generate psuedorandom directions.<br>        self.vx, self.vy = 4*c, 6*d<br>        self.a = .99 #friction<br>        self.cushion = self.w*0.25<br>        <br>        self.puck = PuckManager(canvas, self.w, (self.y, self.x))<br>        <br>    def update(self):<br>        #air hockey table - puck never completely stops.<br>        if self.vx &gt; 0.25: self.vx *= self.a<br>        if self.vy &gt; 0.25: self.vy *= self.a<br>        <br>        x, y = self.x + self.vx, self.y + self.vy<br>        if not self.background.is_position_valid((x, y), self.w):<br>            if x - self.w &lt; ZERO or x + self.w &gt; self.screen[0]:<br>                self.vx *= -1<br>            if y - self.w &lt; ZERO or y + self.w &gt; self.screen[1]:<br>                self.vy *= -1<br>            x, y = self.x+self.vx, self.y+self.vy<br>            <br>        self.x, self.y = x, y<br>        self.puck.update((self.x, self.y))<br><br>    def hit(self, paddle, moving):<br>        x, y = paddle.get_position()<br><br>        if moving:        <br>            if (x &gt; self.x - self.cushion and x &lt; self.x + self.cushion or <br>                                                    abs(self.vx) &gt; MAX_SPEED):<br>                xpower = 1<br>            else:<br>                xpower = 5 if self.vx &lt; 2 else 2<br>            if (y &gt; self.y - self.cushion and y &lt; self.y + self.cushion or <br>                                                    abs(self.vy) &gt; MAX_SPEED):<br>                ypower = 1<br>            else:<br>                ypower = 5 if self.vy &lt; 2 else 2<br>        else:<br>            xpower, ypower = 1, 1<br>            <br>        if self.x + self.cushion &lt; x:<br>            xpower *= -1<br>        if self.y + self.cushion &lt; y:<br>            ypower *= -1<br>        <br>        self.vx = abs(self.vx)*xpower<br>        self.vy = abs(self.vy)*ypower<br>    <br>    def __eq__(self, other):<br>        return other == self.puck<br>    def in_goal(self):<br>        return self.background.is_in_goal((self.x, self.y), self.w)<br><br>class Player(object):<br>    """<br>    master: tk.Tk object.<br>    canvas: tk.Canvas object.<br>    background: Background object.<br>    puck: Puck object.<br>    constraint: UPPER or LOWER (can be None).<br>    """<br>    def __init__(self, master, canvas, background, puck, constraint):<br>        self.puck, self.background = puck, background<br>        self.constraint, self.v = constraint, PADDLE_SPEED<br>        screen = self.background.get_screen()<br>        self.x = screen[0]/2<br>        self.y = 60 if self.constraint == UPPER else screen[1] - 50<br><br>        self.paddle = Paddle(canvas, self.background.get_goal_w()/7,<br>                                                            (self.x, self.y))<br>        self.up, self.down, self.left, self.right = False, False, False, False<br>        <br>        if self.constraint == LOWER:<br>            master.bind('&lt;Up&gt;', self.MoveUp)<br>            master.bind('&lt;Down&gt;', self.MoveDown)<br>            master.bind('&lt;KeyRelease-Up&gt;', self.UpRelease)<br>            master.bind('&lt;KeyRelease-Down&gt;', self.DownRelease)<br>            master.bind('&lt;Right&gt;', self.MoveRight)<br>            master.bind('&lt;Left&gt;', self.MoveLeft)<br>            master.bind('&lt;KeyRelease-Right&gt;', self.RightRelease)<br>            master.bind('&lt;KeyRelease-Left&gt;', self.LeftRelease)<br>        else:<br>            master.bind('&lt;w&gt;', self.MoveUp)<br>            master.bind('&lt;s&gt;', self.MoveDown)<br>            master.bind('&lt;KeyRelease-w&gt;', self.UpRelease)<br>            master.bind('&lt;KeyRelease-s&gt;', self.DownRelease)<br>            master.bind('&lt;d&gt;', self.MoveRight)<br>            master.bind('&lt;a&gt;', self.MoveLeft)<br>            master.bind('&lt;KeyRelease-d&gt;', self.RightRelease)<br>            master.bind('&lt;KeyRelease-a&gt;', self.LeftRelease)<br>        <br>    def update(self):<br>        x, y = self.x, self.y<br>        <br>        if self.up: y = self.y - self.v<br>        if self.down: y = self.y + self.v<br>        if self.left: x = self.x - self.v<br>        if self.right: x = self.x + self.v<br>        <br>        if self.background.is_position_valid((x, y), <br>                                      self.paddle.get_width(), self.constraint):<br>            self.x, self.y = x, y<br>            self.paddle.update((self.x, self.y))<br>        if self.puck == self.paddle:<br>            moving = any((self.up, self.down, self.left, self.right))<br>            self.puck.hit(self.paddle, moving)<br>    <br>    def MoveUp(self, callback=False):<br>        self.up = True<br>    def MoveDown(self, callback=False):<br>        self.down = True<br>    def MoveLeft(self, callback=False):<br>        self.left = True<br>    def MoveRight(self, callback=False):<br>        self.right = True<br>    def UpRelease(self, callback=False):<br>        self.up = False<br>    def DownRelease(self, callback=False):<br>        self.down = False<br>    def LeftRelease(self, callback=False):<br>        self.left = False<br>    def RightRelease(self, callback=False):<br>        self.right = False<br>        <br>class Home(object):<br>    """<br>    Game Manager.<br>    master: tk.Tk object.<br>    screen: tuple, screen size (w, h).<br>    score: dict.<br>    """<br>    def __init__(self, master, screen, score=START_SCORE.copy()):<br>        self.frame = tk.Frame(master)<br>        self.frame.pack()<br>        self.can = tk.Canvas(self.frame)<br>        self.can.pack()<br>        #goal width = 1/3 of screen width<br>        background = Background(self.can, screen, screen[0]*0.33)<br>        self.puck = Puck(self.can, background)<br>        self.p1 = Player(master, self.can, background, self.puck, UPPER)<br>        self.p2 = Player(master, self.can, background, self.puck, LOWER)<br>        <br>        master.bind("&lt;Return&gt;", self.reset)<br>        master.bind("&lt;r&gt;", self.reset)<br>        <br>        master.title(str_dict(score))<br>        <br>        self.master, self.screen, self.score = master, screen, score<br>        <br>        self.update()<br>        <br>    def reset(self, callback=False):<br>        """ &lt;Return&gt; or &lt;r&gt; key. """<br>        if callback.keycode == 82: #r key resets score.<br>            self.score = START_SCORE.copy()<br>        self.frame.destroy()<br>        self.__init__(self.master, self.screen, self.score)<br>        <br>    def update(self):<br>        self.puck.update()<br>        self.p1.update()<br>        self.p2.update()<br>        if not self.puck.in_goal():<br>            self.frame.after(SPEED, self.update) <br>        else:<br>            winner = HOME if self.puck.in_goal() == AWAY else AWAY<br>            self.update_score(winner)<br>            <br>    def update_score(self, winner):<br>        self.score[winner] += 1<br>        self.master.title(str_dict(self.score))<br>        if self.score[winner] == MAX_SCORE:<br>            self.frame.bell()<br>            self.can.create_text(self.screen[0]/2, self.screen[1]/2, font=FONT,<br>                                                     text="%s wins!" % winner)<br>            self.score = START_SCORE.copy()<br>        else:<br>            self.can.create_text(self.screen[0]/2, self.screen[1]/2, font=FONT,<br>                                                 text="Point for %s" % winner)<br>                                                 <br>def play(screen):<br>    """ screen: tuple, screen size (w, h). """<br>    root = tk.Tk()<br>#    root.state("zoomed")<br>#    root.resizable(0, 0)<br>    Home(root, screen)<br>    #root.eval('tk::PlaceWindow %s center' %root.winfo_pathname(root.winfo_id()))<br>    root.mainloop()<br>            <br>if __name__ == "__main__":<br>    """ Choose screen size """  <br>    screen = 700, 760<br>    <br>    play(screen)</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/641ac1142ee86fe8f4a7c22309ee3a57/images.jpeg" />
         <pubDate>2020-11-18 09:50:33 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935846355</guid>
      </item>
      <item>
         <title>Alien Attack</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935855577</link>
         <description><![CDATA[<div>import pygame<br>import random<br><br># Define some colors<br>BLACK    = (   0,   0,   0)<br>WHITE    = ( 255, 255, 255)<br>RED      = ( 255,   0,   0)<br>BLUE     = (   0,   0, 255)<br><br># --- Classes<br><br>class Block(pygame.sprite.Sprite):<br>    """ This class represents the block. """<br>    def __init__(self, color):<br>        # Call the parent class (Sprite) constructor<br>        super().__init__()<br><br>        self.image = pygame.Surface([20, 15])<br>        self.image.fill(color)<br><br>        self.rect = self.image.get_rect()<br><br>class Player(pygame.sprite.Sprite):<br>    """ This class represents the Player. """<br><br>    def __init__(self):<br>        """ Set up the player on creation. """<br>        # Call the parent class (Sprite) constructor<br>        super().__init__()<br><br>        self.image = pygame.Surface([20, 20])<br>        self.image.fill(RED)<br><br>        self.rect = self.image.get_rect()<br><br>    def update(self):<br>        """ Update the player's position. """<br>        # Get the current mouse position. This returns the position<br>        # as a list of two numbers.<br>        pos = pygame.mouse.get_pos()<br><br>        # Set the player x position to the mouse x position<br>        self.rect.x = pos[0]<br><br>class Bullet(pygame.sprite.Sprite):<br>    """ This class represents the bullet . """<br>    def __init__(self):<br>        # Call the parent class (Sprite) constructor<br>        super().__init__()<br><br>        self.image = pygame.Surface([4, 10])<br>        self.image.fill(BLACK)<br><br>        self.rect = self.image.get_rect()<br><br>    def update(self):<br>        """ Move the bullet. """<br>        self.rect.y -= 3<br><br><br># --- Create the window<br><br># Initialize Pygame<br>pygame.init()<br><br># Set the height and width of the screen<br>screen_width = 700<br>screen_height = 400<br>screen = pygame.display.set_mode([screen_width, screen_height])<br><br># --- Sprite lists<br><br># This is a list of every sprite. All blocks and the player block as well.<br>all_sprites_list = pygame.sprite.Group()<br><br># List of each block in the game<br>block_list = pygame.sprite.Group()<br><br># List of each bullet<br>bullet_list = pygame.sprite.Group()<br><br># --- Create the sprites<br><br>for i in range(50):<br>    # This represents a block<br>    block = Block(BLUE)<br><br>    # Set a random location for the block<br>    block.rect.x = random.randrange(screen_width)<br>    block.rect.y = random.randrange(350)<br><br>    # Add the block to the list of objects<br>    block_list.add(block)<br>    all_sprites_list.add(block)<br><br># Create a red player block<br>player = Player()<br>all_sprites_list.add(player)<br><br>#Loop until the user clicks the close button.<br>done = False<br><br># Used to manage how fast the screen updates<br>clock = pygame.time.Clock()<br><br>score = 0<br>player.rect.y = 370<br><br># -------- Main Program Loop -----------<br>while not done:<br>    # --- Event Processing<br>    for event in pygame.event.get():<br>        if event.type == pygame.QUIT:<br>            done = True<br><br>        elif event.type == pygame.MOUSEBUTTONDOWN:<br>            # Fire a bullet if the user clicks the mouse button<br>            bullet = Bullet()<br>            # Set the bullet so it is where the player is<br>            bullet.rect.x = player.rect.x<br>            bullet.rect.y = player.rect.y<br>            # Add the bullet to the lists<br>            all_sprites_list.add(bullet)<br>            bullet_list.add(bullet)<br><br>    # --- Game logic<br><br>    # Call the update() method on all the sprites<br>    all_sprites_list.update()<br><br>    # Calculate mechanics for each bullet<br>    for bullet in bullet_list:<br><br>        # See if it hit a block<br>        block_hit_list = pygame.sprite.spritecollide(bullet, block_list, True)<br><br>        # For each block hit, remove the bullet and add to the score<br>        for block in block_hit_list:<br>            bullet_list.remove(bullet)<br>            all_sprites_list.remove(bullet)<br>            score += 1<br>            print(score)<br><br>        # Remove the bullet if it flies up off the screen<br>        if bullet.rect.y &lt; -10:<br>            bullet_list.remove(bullet)<br>            all_sprites_list.remove(bullet)<br><br>    # --- Draw a frame<br><br>    # Clear the screen<br>    screen.fill(WHITE)<br><br>    # Draw all the spites<br>    all_sprites_list.draw(screen)<br><br>    # Go ahead and update the screen with what we've drawn.<br>    pygame.display.flip()<br><br>    # --- Limit to 20 frames per second<br>    clock.tick(60)<br><br>pygame.quit()<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/72ce345f792a4439f0031163a6a44e55/unnamed.png" />
         <pubDate>2020-11-18 09:53:27 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935855577</guid>
      </item>
      <item>
         <title>Animated Snowfalls</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935866610</link>
         <description><![CDATA[<div><br># Import a library of functions called 'pygame'<br>import pygame<br>import random<br><br># Initialize the game engine<br>pygame.init()<br><br>BLACK = [  0,   0,   0]<br>WHITE = [255, 255, 255]<br><br># Set the height and width of the screen<br>SIZE = [400, 400]<br><br>screen = pygame.display.set_mode(SIZE)<br>pygame.display.set_caption("Snow Animation")<br><br># Create an empty array<br>snow_list = []<br><br># Loop 50 times and add a snow flake in a random x,y position<br>for i in range(50):<br>    x = random.randrange(0, 400)<br>    y = random.randrange(0, 400)<br>    snow_list.append([x, y])<br><br>clock = pygame.time.Clock()<br><br>#Loop until the user clicks the close button.<br>done = False<br>while done == False:<br><br>    for event in pygame.event.get(): # User did something<br>        if event.type == pygame.QUIT: # If user clicked close<br>            done = True # Flag that we are done so we exit this loop<br><br>    # Set the screen background<br>    screen.fill(BLACK)<br><br>    # Process each snow flake in the list<br>    for i in range(len(snow_list)):<br>    <br>        # Draw the snow flake<br>        pygame.draw.circle(screen, WHITE, snow_list[i], 2)<br>        <br>        # Move the snow flake down one pixel<br>        snow_list[i][1] += 1<br>        <br>        # If the snow flake has moved off the bottom of the screen<br>        if snow_list[i][1] &gt; 400:<br>            # Reset it just above the top<br>            y = random.randrange(-50, -10)<br>            snow_list[i][1] = y<br>            # Give it a new x position<br>            x = random.randrange(0, 400)<br>            snow_list[i][0] = x<br>            <br>    # Go ahead and update the screen with what we've drawn.<br>    pygame.display.flip()<br>    clock.tick(20)<br>            <br># Be IDLE friendly. If you forget this line, the program will 'hang'<br># on exit.<br>pygame.quit ()<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/b03607e58eb1c5f56fa856ff3c9b836a/images__1_.jpeg" />
         <pubDate>2020-11-18 09:56:51 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935866610</guid>
      </item>
      <item>
         <title>Bouncing Cube</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935884652</link>
         <description><![CDATA[<div>import pygame<br><br># Define some colors<br>BLACK = (0, 0, 0)<br>WHITE = (255, 255, 255)<br>GREEN = (0, 255, 0)<br>RED = (255, 0, 0)<br><br>pygame.init()<br><br># Set the height and width of the screen<br>size = [700, 500]<br>screen = pygame.display.set_mode(size)<br><br>pygame.display.set_caption("Instruction Screen")<br><br>#Loop until the user clicks the close button.<br>done = False<br><br># Used to manage how fast the screen updates<br>clock = pygame.time.Clock()<br><br># Starting position of the rectangle<br>rect_x = 50<br>rect_y = 50<br><br># Speed and direction of rectangle<br>rect_change_x = 5<br>rect_change_y = 5<br><br># This is a font we use to draw text on the screen (size 36)<br>font = pygame.font.Font(None, 36)<br><br>display_instructions = True<br>instruction_page = 1<br><br># -------- Instruction Page Loop -----------<br>while not done and display_instructions:<br>    for event in pygame.event.get(): # User did something<br>        if event.type == pygame.QUIT: # If user clicked close<br>            done = True # Flag that we are done so we exit this loop<br>        if event.type == pygame.MOUSEBUTTONDOWN:<br>            instruction_page += 1<br>            if instruction_page == 3:<br>                display_instructions = False<br><br>    # Set the screen background<br>    screen.fill(BLACK)<br><br>    if instruction_page == 1:<br>        # Draw instructions, page 1<br>        # This could also load an image created in another program.<br>        # That could be both easier and more flexible.<br><br>        text = font.render("Instructions", True, WHITE)<br>        screen.blit(text, [10, 10])<br><br>        text = font.render("Page 1", True, WHITE)<br>        screen.blit(text, [10, 40])<br><br>    if instruction_page == 2:<br>        # Draw instructions, page 2<br>        text = font.render("This program bounces a rectangle", True, WHITE)<br>        screen.blit(text, [10, 10])<br><br>        text = font.render("Page 2", True, WHITE)<br>        screen.blit(text, [10, 40])<br><br>    # Limit to 60 frames per second<br>    clock.tick(60)<br><br>    # Go ahead and update the screen with what we've drawn.<br>    pygame.display.flip()<br><br># -------- Main Program Loop -----------<br>while not done:<br>    for event in pygame.event.get(): # User did something<br>        if event.type == pygame.QUIT: # If user clicked close<br>            done = True # Flag that we are done so we exit this loop<br><br>    # Set the screen background<br>    screen.fill(BLACK)<br><br>    # Draw the rectangle<br>    pygame.draw.rect(screen, WHITE, [rect_x, rect_y, 50, 50])<br><br>    # Move the rectangle starting point<br>    rect_x += rect_change_x<br>    rect_y += rect_change_y<br><br>    # Bounce the ball if needed<br>    if rect_y &gt; 450 or rect_y &lt; 0:<br>        rect_change_y = rect_change_y * -1<br>    if rect_x &gt; 650 or rect_x &lt; 0:<br>        rect_change_x = rect_change_x * -1<br><br>    # Limit to 60 frames per second<br>    clock.tick(60)<br><br>    # Go ahead and update the screen with what we've drawn.<br>    pygame.display.flip()<br><br># Be IDLE friendly. If you forget this line, the program will 'hang'<br># on exit.<br>pygame.quit()<br><br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/fb87d52c811be5bb45373b04982629db/unnamed.png" />
         <pubDate>2020-11-18 10:02:43 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935884652</guid>
      </item>
      <item>
         <title>Wall Break</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935893845</link>
         <description><![CDATA[<div># --- Import libraries used for this program<br><br>import math<br>import pygame<br><br># Define some colors<br>black = (0, 0, 0)<br>white = (255, 255, 255)<br>blue = (0, 0, 255)<br><br># Size of break-out blocks<br>block_width = 23<br>block_height = 15<br><br>class Block(pygame.sprite.Sprite):<br>    """This class represents each block that will get knocked out by the ball<br>    It derives from the "Sprite" class in Pygame """<br><br>    def __init__(self, color, x, y):<br>        """ Constructor. Pass in the color of the block, <br>            and its x and y position. """<br>        <br>        # Call the parent class (Sprite) constructor<br>        super().__init__()<br>        <br>        # Create the image of the block of appropriate size<br>        # The width and height are sent as a list for the first parameter.<br>        self.image = pygame.Surface([block_width, block_height])<br>        <br>        # Fill the image with the appropriate color<br>        self.image.fill(color)<br>        <br>        # Fetch the rectangle object that has the dimensions of the image<br>        self.rect = self.image.get_rect()<br>        <br>        # Move the top left of the rectangle to x,y.<br>        # This is where our block will appear..<br>        self.rect.x = x<br>        self.rect.y = y<br><br><br>class Ball(pygame.sprite.Sprite):<br>    """ This class represents the ball        <br>        It derives from the "Sprite" class in Pygame """<br>    <br>    # Speed in pixels per cycle<br>    speed = 10.0<br>    <br>    # Floating point representation of where the ball is<br>    x = 0.0<br>    y = 180.0<br>    <br>    # Direction of ball (in degrees)<br>    direction = 200<br><br>    width = 10<br>    height = 10<br>    <br>    # Constructor. Pass in the color of the block, and its x and y position<br>    def __init__(self):<br>        # Call the parent class (Sprite) constructor<br>        super().__init__()<br>        <br>        # Create the image of the ball<br>        self.image = pygame.Surface([self.width, self.height])<br>        <br>        # Color the ball<br>        self.image.fill(white)<br>        <br>        # Get a rectangle object that shows where our image is<br>        self.rect = self.image.get_rect()<br>        <br>        # Get attributes for the height/width of the screen<br>        self.screenheight = pygame.display.get_surface().get_height()<br>        self.screenwidth = pygame.display.get_surface().get_width()<br>    <br>    def bounce(self, diff):<br>        """ This function will bounce the ball <br>            off a horizontal surface (not a vertical one) """<br>        <br>        self.direction = (180 - self.direction) % 360<br>        self.direction -= diff<br>    <br>    def update(self):<br>        """ Update the position of the ball. """<br>        # Sine and Cosine work in degrees, so we have to convert them<br>        direction_radians = math.radians(self.direction)<br>        <br>        # Change the position (x and y) according to the speed and direction<br>        self.x += self.speed * math.sin(direction_radians)<br>        self.y -= self.speed * math.cos(direction_radians)<br>        <br>        # Move the image to where our x and y are<br>        self.rect.x = self.x<br>        self.rect.y = self.y<br>        <br>        # Do we bounce off the top of the screen?<br>        if self.y &lt;= 0:<br>            self.bounce(0)<br>            self.y = 1<br>            <br>        # Do we bounce off the left of the screen?<br>        if self.x &lt;= 0:<br>            self.direction = (360 - self.direction) % 360<br>            self.x = 1<br>            <br>        # Do we bounce of the right side of the screen?<br>        if self.x &gt; self.screenwidth - self.width:<br>            self.direction = (360 - self.direction) % 360<br>            self.x = self.screenwidth - self.width - 1<br>        <br>        # Did we fall off the bottom edge of the screen?<br>        if self.y &gt; 600:<br>            return True<br>        else:<br>            return False<br><br>class Player(pygame.sprite.Sprite):<br>    """ This class represents the bar at the bottom that the player controls. """<br>    <br>    def __init__(self):<br>        """ Constructor for Player. """<br>        # Call the parent's constructor<br>        super().__init__()<br>        <br>        self.width = 75<br>        self.height = 15<br>        self.image = pygame.Surface([self.width, self.height])<br>        self.image.fill((white))<br>        <br>        # Make our top-left corner the passed-in location.<br>        self.rect = self.image.get_rect()<br>        self.screenheight = pygame.display.get_surface().get_height()<br>        self.screenwidth = pygame.display.get_surface().get_width()<br><br>        self.rect.x = 0<br>        self.rect.y = self.screenheight-self.height<br>    <br>    def update(self):<br>        """ Update the player position. """<br>        # Get where the mouse is<br>        pos = pygame.mouse.get_pos()<br>        # Set the left side of the player bar to the mouse position<br>        self.rect.x = pos[0]<br>        # Make sure we don't push the player paddle <br>        # off the right side of the screen<br>        if self.rect.x &gt; self.screenwidth - self.width:<br>            self.rect.x = self.screenwidth - self.width<br><br># Call this function so the Pygame library can initialize itself<br>pygame.init()<br><br># Create an 800x600 sized screen<br>screen = pygame.display.set_mode([800, 600])<br><br># Set the title of the window<br>pygame.display.set_caption('Breakout')<br><br># Enable this to make the mouse disappear when over our window<br>pygame.mouse.set_visible(0)<br><br># This is a font we use to draw text on the screen (size 36)<br>font = pygame.font.Font(None, 36)<br><br># Create a surface we can draw on<br>background = pygame.Surface(screen.get_size())<br><br># Create sprite lists<br>blocks = pygame.sprite.Group()<br>balls = pygame.sprite.Group()<br>allsprites = pygame.sprite.Group()<br><br># Create the player paddle object<br>player = Player()<br>allsprites.add(player)<br><br># Create the ball<br>ball = Ball()<br>allsprites.add(ball)<br>balls.add(ball)<br><br># The top of the block (y position)<br>top = 80<br><br># Number of blocks to create<br>blockcount = 32<br><br># --- Create blocks<br><br># Five rows of blocks<br>for row in range(5):<br>    # 32 columns of blocks<br>    for column in range(0, blockcount):<br>        # Create a block (color,x,y)<br>        block = Block(blue, column * (block_width + 2) + 1, top)<br>        blocks.add(block)<br>        allsprites.add(block)<br>    # Move the top of the next row down<br>    top += block_height + 2<br><br># Clock to limit speed<br>clock = pygame.time.Clock()<br><br># Is the game over?<br>game_over = False<br><br># Exit the program?<br>exit_program = False<br><br># Main program loop<br>while exit_program != True:<br><br>    # Limit to 30 fps<br>    clock.tick(30)<br><br>    # Clear the screen<br>    screen.fill(black)<br>    <br>    # Process the events in the game<br>    for event in pygame.event.get():<br>        if event.type == pygame.QUIT:<br>            exit_program = True<br>    <br>    # Update the ball and player position as long<br>    # as the game is not over.<br>    if not game_over:<br>        # Update the player and ball positions<br>        player.update()<br>        game_over = ball.update()<br>    <br>    # If we are done, print game over<br>    if game_over:<br>        text = font.render("Game Over", True, white)<br>        textpos = text.get_rect(centerx=background.get_width()/2)<br>        textpos.top = 300<br>        screen.blit(text, textpos)<br>    <br>    # See if the ball hits the player paddle<br>    if pygame.sprite.spritecollide(player, balls, False):<br>        # The 'diff' lets you try to bounce the ball left or right <br>        # depending where on the paddle you hit it<br>        diff = (player.rect.x + player.width/2) - (ball.rect.x+ball.width/2)<br>        <br>        # Set the ball's y position in case <br>        # we hit the ball on the edge of the paddle<br>        ball.rect.y = screen.get_height() - player.rect.height - ball.rect.height - 1<br>        ball.bounce(diff)<br>    <br>    # Check for collisions between the ball and the blocks<br>    deadblocks = pygame.sprite.spritecollide(ball, blocks, True)<br>    <br>    # If we actually hit a block, bounce the ball<br>    if len(deadblocks) &gt; 0:<br>        ball.bounce(0)<br>        <br>        # Game ends if all the blocks are gone<br>        if len(blocks) == 0:<br>            game_over = True<br>    <br>    # Draw Everything<br>    allsprites.draw(screen)<br><br>    # Flip the screen and show what we've drawn<br>    pygame.display.flip()<br><br>pygame.quit()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/18fcbfa148a7a4efcd8e193769af7ac4/unnamed.png" />
         <pubDate>2020-11-18 10:05:52 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935893845</guid>
      </item>
      <item>
         <title>Cannon Game</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935905628</link>
         <description><![CDATA[<div>from random import randrange<br>from turtle import *<br>from freegames import vector<br><br>ball = vector(-200, -200)<br>speed = vector(0, 0)<br>targets = []<br><br>def tap(x, y):<br>    "Respond to screen tap."<br>    if not inside(ball):<br>        ball.x = -199<br>        ball.y = -199<br>        speed.x = (x + 200) / 25<br>        speed.y = (y + 200) / 25<br><br>def inside(xy):<br>    "Return True if xy within screen."<br>    return -200 &lt; xy.x &lt; 200 and -200 &lt; xy.y &lt; 200<br><br>def draw():<br>    "Draw ball and targets."<br>    clear()<br><br>    for target in targets:<br>        goto(target.x, target.y)<br>        dot(20, 'blue')<br><br>    if inside(ball):<br>        goto(ball.x, ball.y)<br>        dot(6, 'red')<br><br>    update()<br><br>def move():<br>    "Move ball and targets."<br>    if randrange(40) == 0:<br>        y = randrange(-150, 150)<br>        target = vector(200, y)<br>        targets.append(target)<br><br>    for target in targets:<br>        target.x -= 0.5<br><br>    if inside(ball):<br>        speed.y -= 0.35<br>        ball.move(speed)<br><br>    dupe = targets.copy()<br>    targets.clear()<br><br>    for target in dupe:<br>        if abs(target - ball) &gt; 13:<br>            targets.append(target)<br><br>    draw()<br><br>    for target in targets:<br>        if not inside(target):<br>            return<br><br>    ontimer(move, 50)<br><br>setup(420, 420, 370, 0)<br>hideturtle()<br>up()<br>tracer(False)<br>onscreenclick(tap)<br>move()<br>done()<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/be92fd6a5a7d71dbc2fb68abc88316ac/images__1_.jpeg" />
         <pubDate>2020-11-18 10:09:51 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935905628</guid>
      </item>
      <item>
         <title>Catch me if you can!!</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935918451</link>
         <description><![CDATA[<div>import pygame<br>import random<br>import math<br><br># Define some colors<br>BLACK    = (   0,   0,   0)<br>WHITE    = ( 255, 255, 255)<br>RED      = ( 255,   0,   0)<br><br><br>class Block(pygame.sprite.Sprite):<br>    """ This class represents the ball that moves in a circle. """<br><br>    def __init__(self, color, width, height):<br>        """ Constructor that create's the ball's image. """<br>        super().__init__()<br>        self.image = pygame.Surface([width, height])<br>        self.image.fill(color)<br>        self.rect = self.image.get_rect()<br><br>        # The "center" the sprite will orbit<br>        self.center_x = 0<br>        self.center_y = 0<br><br>        # Current angle in radians<br>        self.angle = 0<br><br>        # How far away from the center to orbit, in pixels<br>        self.radius = 0<br><br>        # How fast to orbit, in radians per frame<br>        self.speed = 0.05<br><br>    def update(self):<br>        """ Update the ball's position. """<br>        # Calculate a new x, y<br>        self.rect.x = self.radius * math.sin(self.angle) + self.center_x<br>        self.rect.y = self.radius * math.cos(self.angle) + self.center_y<br><br>        # Increase the angle in prep for the next round.<br>        self.angle += self.speed<br><br>class Player(pygame.sprite.Sprite):<br>    """ Class to represent the player. """<br>    def __init__(self, color, width, height):<br>        """ Create the player image. """<br>        super().__init__()<br>        self.image = pygame.Surface([width, height])<br>        self.image.fill(color)<br>        self.rect = self.image.get_rect()<br><br>    def update(self):<br>        """Set the user to be where the mouse is. """<br>        pos = pygame.mouse.get_pos()<br>        self.rect.x = pos[0]<br>        self.rect.y = pos[1]<br><br># Initialize Pygame<br>pygame.init()<br><br># Set the height and width of the screen<br>SCREEN_WIDTH = 700<br>SCREEN_HEIGHT = 400<br>screen = pygame.display.set_mode([SCREEN_WIDTH, SCREEN_HEIGHT])<br><br># This is a list of 'sprites.' Each block in the program is<br># added to this list. The list is managed by a class called 'Group.'<br>block_list = pygame.sprite.Group()<br><br># This is a list of every sprite. All blocks and the player block as well.<br>all_sprites_list = pygame.sprite.Group()<br><br>for i in range(50):<br>    # This represents a block<br>    block = Block(BLACK, 20, 15)<br><br>    # Set a random center location for the block to orbit<br>    block.center_x = random.randrange(SCREEN_WIDTH)<br>    block.center_y = random.randrange(SCREEN_HEIGHT)<br>    # Random radius from 10 to 200<br>    block.radius = random.randrange(10, 200)<br>    # Random start angle from 0 to 2pi<br>    block.angle = random.random() * 2 * math.pi<br>    # radians per frame<br>    block.speed = 0.008<br>    # Add the block to the list of objects<br>    block_list.add(block)<br>    all_sprites_list.add(block)<br><br># Create a RED player block<br>player = Player(RED, 20, 15)<br>all_sprites_list.add(player)<br><br>#Loop until the user clicks the close button.<br>done = False<br><br># Used to manage how fast the screen updates<br>clock = pygame.time.Clock()<br><br>score = 0<br><br># -------- Main Program Loop -----------<br>while not done:<br>    for event in pygame.event.get(): # User did something<br>        if event.type == pygame.QUIT: # If user clicked close<br>            done = True # Flag that we are done so we exit this loop<br><br>    all_sprites_list.update()<br><br>    # Clear the screen<br>    screen.fill(WHITE)<br><br>    # See if the player block has collided with anything.<br>    blocks_hit_list = pygame.sprite.spritecollide(player, block_list, True)<br><br>    # Check the list of collisions.<br>    for block in blocks_hit_list:<br>        score += 1<br>        print( score )<br><br>    # Draw all the spites<br>    all_sprites_list.draw(screen)<br><br>    # Go ahead and update the screen with what we've drawn.<br>    pygame.display.flip()<br><br>    # Limit to 60 frames per second<br>    clock.tick(60)<br><br>pygame.quit()</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/a0e8e045dc8e3786f4bd441112c9e8fc/images.png" />
         <pubDate>2020-11-18 10:14:08 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935918451</guid>
      </item>
      <item>
         <title>Roll the Dice</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935943238</link>
         <description><![CDATA[<div>import random<br>min = 1<br>max = 6<br><br>roll_again = "yes"<br><br>while roll_again == "yes" or roll_again == "y":<br>    print ("Rolling the dices...")<br>    print ("The values are....")<br>    print( random.randint(min, max))<br>    print (random.randint(min, max))<br><br>    roll_again = input("Roll the dices again?: ")<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/f35ab4b0e78b99b07b273aa80765670d/download.jpeg" />
         <pubDate>2020-11-18 10:21:56 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935943238</guid>
      </item>
      <item>
         <title>Fill it !!!</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935953027</link>
         <description><![CDATA[<div>import pygame<br><br># Define some colors<br>BLACK    = (   0,   0,   0)<br>WHITE    = ( 255, 255, 255)<br>GREEN    = (   0, 255,   0)<br>RED      = ( 255,   0,   0)<br><br># This sets the width and height of each grid location<br>width  = 20<br>height = 20<br><br># This sets the margin between each cell<br>margin = 5<br><br># Create a 2 dimensional array. A two dimensional<br># array is simply a list of lists.<br>grid = []<br>for row in range(10):<br>    # Add an empty array that will hold each cell<br>    # in this row<br>    grid.append([])<br>    for column in range(10):<br>        grid[row].append(0) # Append a cell<br><br># Set row 1, cell 5 to one. (Remember rows and<br># column numbers start at zero.)<br>grid[1][5] = 1<br><br># Initialize pygame<br>pygame.init()<br><br># Set the height and width of the screen<br>size = [255, 255]<br>screen = pygame.display.set_mode(size)<br><br># Set title of screen<br>pygame.display.set_caption("Array Backed Grid")<br><br>#Loop until the user clicks the close button.<br>done = False<br><br># Used to manage how fast the screen updates<br>clock = pygame.time.Clock()<br><br># -------- Main Program Loop -----------<br>while done == False:<br>    for event in pygame.event.get(): # User did something<br>        if event.type == pygame.QUIT: # If user clicked close<br>            done = True # Flag that we are done so we exit this loop<br>        elif event.type == pygame.MOUSEBUTTONDOWN:<br>            # User clicks the mouse. Get the position<br>            pos = pygame.mouse.get_pos()<br>            # Change the x/y screen coordinates to grid coordinates<br>            column = pos[0] // (width + margin)<br>            row = pos[1] // (height + margin)<br>            # Set that location to zero<br>            grid[row][column] = 1<br>            print("Click ", pos, "Grid coordinates: ", row, column)<br><br>    # Set the screen background<br>    screen.fill(BLACK)<br><br>    # Draw the grid<br>    for row in range(10):<br>        for column in range(10):<br>            color = WHITE<br>            if grid[row][column] == 1:<br>                color = GREEN<br>            pygame.draw.rect(screen,<br>                             color,<br>                             [(margin+width)*column+margin,<br>                              (margin+height)*row+margin,<br>                              width,<br>                              height])<br><br>    # Limit to 60 frames per second<br>    clock.tick(60)<br><br>    # Go ahead and update the screen with what we've drawn.<br>    pygame.display.flip()<br><br># Be IDLE friendly. If you forget this line, the program will 'hang'<br># on exit.<br>pygame.quit()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/06d1570282d94af64aecd94fba4edaf6/download.jpeg" />
         <pubDate>2020-11-18 10:25:06 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935953027</guid>
      </item>
      <item>
         <title>Flappy Bird</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935975821</link>
         <description><![CDATA[<div>from random import *<br>from turtle import *<br>from freegames import vector<br><br>bird = vector(0, 0)<br>balls = []<br><br>def tap(x, y):<br>    "Move bird up in response to screen tap."<br>    up = vector(0, 30)<br>    bird.move(up)<br><br>def inside(point):<br>    "Return True if point on screen."<br>    return -200 &lt; point.x &lt; 200 and -200 &lt; point.y &lt; 200<br><br>def draw(alive):<br>    "Draw screen objects."<br>    clear()<br><br>    goto(bird.x, bird.y)<br><br>    if alive:<br>        dot(10, 'green')<br>    else:<br>        dot(10, 'red')<br><br>    for ball in balls:<br>        goto(ball.x, ball.y)<br>        dot(20, 'black')<br><br>    update()<br><br>def move():<br>    "Update object positions."<br>    bird.y -= 5<br><br>    for ball in balls:<br>        ball.x -= 3<br><br>    if randrange(10) == 0:<br>        y = randrange(-199, 199)<br>        ball = vector(199, y)<br>        balls.append(ball)<br><br>    while len(balls) &gt; 0 and not inside(balls[0]):<br>        balls.pop(0)<br><br>    if not inside(bird):<br>        draw(False)<br>        return<br><br>    for ball in balls:<br>        if abs(ball - bird) &lt; 15:<br>            draw(False)<br>            return<br><br>    draw(True)<br>    ontimer(move, 50)<br><br>setup(420, 420, 370, 0)<br>hideturtle()<br>up()<br>tracer(False)<br>onscreenclick(tap)<br>move()<br>done()<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/f6f4192c81cf35e023d29ab518a80466/images.png" />
         <pubDate>2020-11-18 10:33:00 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935975821</guid>
      </item>
      <item>
         <title>Stone , Paper , Scissor</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935988786</link>
         <description><![CDATA[<div>import random<br><br>games = 0<br>won = 0<br>lost = 0<br>tie = 0<br>choice = "Y"<br>while choice != 'N':<br>  ans = int(input('Enter 1-Rock 2- Paper 3 -Scissor : '))<br>  comp = random.randint(1, 3)<br>  if ans == comp:<br>     print("tie !!!!!!!!!!!!!!!!")<br>     tie += 1<br>  if ans == 1:<br>     if(comp == 3):<br>         print("You won")<br>         won += 1<br>     elif(comp == 2):<br>         print("You lost")<br>         lost += 1<br>  if(ans == 2):<br>      if(comp == 1):<br>         print("You won")<br>         won += 1<br>      elif(comp == 3):<br>         print("You lost")<br>         lost += 1<br>if(ans == 3):<br>     if(comp == 2):<br>         print("You won")<br>         won += 1<br>     elif(comp == 1):<br>         print("You lost")<br>         lost += 1<br>         games += 1<br>         choice = input("Want to play more( Y/N) :").upper()<br><br>print('\n\n\n Simple stat of this Game \n')<br>print(' Total guess  :', games)<br>print("You won Games :", won)<br>print("You lost Games :", lost)<br>print("Tie Games :", tie)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/4287fd86895ffda962ea6559d1077a85/images.png" />
         <pubDate>2020-11-18 10:37:08 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/935988786</guid>
      </item>
      <item>
         <title>Menu driven of Tic Tac Toe &amp; Stone Paper Scissor</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936026043</link>
         <description><![CDATA[<div>import os<br>import time<br>import random<br><br><br>def welcome():<br>    for i in range(0, 11):<br>        print("*", end="")<br>    print()<br>    print("* WELCOME *", end="")<br>    print()<br>    for i in range(0, 11):<br>        print("*", end="")<br>    print()<br>    input("Press ENTER key to start")<br>    option()<br><br><br>def option():<br>    for i in range(0, 21):<br>        print("*", end="")<br>    print()<br>    print("1)StonePaperScissors\n2)TicTacToe")<br>    for i in range(0, 21):<br>        print("*", end="")<br>    print()<br>    chc = int(input("Enter your choice number: "))<br>    if chc == 1:<br>        stonepaperscissor()<br>    elif chc == 2:<br>        tictactoemenu()<br>    else:<br>        welcome()<br><br><br>def stonepaperscissor():<br>    print("STONE,PAPER,SCISSORS")<br>    print("You will be competing against the computer")<br>    print("The competitor who first scores 5 points will be declared as the winner")<br>    print("For Stone,Enter 0")<br>    print("For Paper,Enter 1")<br>    print("For Scissors,Enter 2")<br>    print("To EndGame and go back to MainMenu,Enter -1")<br>    user = 0<br>    comp = 0<br>    cnt = 0<br>    choice_play = ["Stone", "Paper", "Scissors"]<br>    while user &lt; 5 and comp &lt; 5 and cnt &lt; 25:<br>        cnt += 1<br>        a = int(input("Enter your choice="))<br>        for i in range(0, 20):<br>            print("*", end="")<br>        print()<br>        if a == -1:<br>            print("Thankyou For Playing")<br>            welcome()<br>            break<br>        b = random.choice([0, 1, 2])<br>        if a == 0 and b == 1:<br>            comp += 1<br>        elif a == 0 and b == 2:<br>            user += 1<br>        elif a == 1 and b == 0:<br>            user += 1<br>        elif a == 1 and b == 2:<br>            comp += 1<br>        elif a == 2 and b == 0:<br>            comp += 1<br>        elif a == 2 and b == 1:<br>            user += 1<br>        print("You:", choice_play[a])<br>        print("Computer:", choice_play[b])<br>        print("Scores")<br>        print("You=", user, "\t Computer=", comp)<br>        for i in range(0, 20):<br>            print("*", end="")<br>        print()<br>        if(user &gt; comp and user == 5):<br>            print("Congratulations!!You are the Winner!")<br>        elif(user &lt; comp and comp == 5):<br>            print("Sorry!!Better luck next time!")<br>        elif(user == comp and cnt &gt;= 25):<br>            print("Its a Draw")<br><br><br>def tictactoemenu():<br>    print("Welcome To TicTacToe")<br>    for i in range(0, 21):<br>        print("*", end="")<br>    print()<br>    print("1)TwoPlayer\n2)OnePlayer")<br>    for i in range(0, 21):<br>        print("*", end="")<br>    print()<br>    chc = int(input("Enter your choice number: "))<br>    if chc == 1:<br>        two_player()<br>    elif chc == 2:<br>        single_player()<br>    else:<br>        option()<br><br><br>def two_player():<br>    board = ["", " ", " ", " ", " ", " ", " ", " ", " ", " "]<br><br>    def rules():<br>        print("Welcome to TICTACTOE")<br>        print("This is a two player game where USER1 is X and USER2 is O")<br>        print("Enter your choice from 1 to 9")<br>        print("""<br>                1 | 2 | 3<br>                ---|---|---<br>                4 | 5 | 6<br>                ---|---|---<br>                7 | 8 | 9<br>                """)<br><br>    def print_board():<br>        print("   |   |   ")<br>        print(" "+board[1]+" | "+board[2]+" | "+board[3]+" ")<br>        print("   |   |   ")<br>        print("---|---|---")<br>        print("   |   |   ")<br>        print(" "+board[4]+" | "+board[5]+" | "+board[6]+" ")<br>        print("   |   |   ")<br>        print("---|---|---")<br>        print("   |   |   ")<br>        print(" "+board[7]+" | "+board[8]+" | "+board[9]+" ")<br>        print("   |   |   ")<br><br>    def is_winner(board, player):<br>        if (board[1] == player and board[2] == player and board[3] == player) or \<br>            (board[4] == player and board[5] == player and board[6] == player) or \<br>            (board[7] == player and board[8] == player and board[9] == player) or \<br>            (board[1] == player and board[4] == player and board[7] == player) or \<br>            (board[2] == player and board[5] == player and board[8] == player) or \<br>            (board[3] == player and board[6] == player and board[9] == player) or \<br>            (board[1] == player and board[5] == player and board[9] == player) or \<br>                (board[3] == player and board[5] == player and board[7] == player):<br>            return True<br>        else:<br>            return False<br><br>    def is_board_full(board):<br>        if " " in board:<br>            return False<br>        else:<br>            return True<br><br>    while True:<br>        os.system("clear")<br>        rules()<br>        print_board()<br><br>        # user 1<br>        choice = input("Please choose an empty space for X: ")<br>        choice = int(choice)<br>        if board[choice] == " ":<br>            board[choice] = "X"<br>        else:<br>            print("Spot already taken")<br>            time.sleep(1)<br>        # for user 1 to win<br>        if is_winner(board, "X"):<br>            os.system("clear")<br>            rules()<br>            print_board()<br>            print("USER1 Win")<br>            break<br><br>        os.system("clear")<br>        rules()<br>        print_board()<br><br>        # check if board is full i.e. a tie<br>        if is_board_full(board):<br>            print("Tie")<br>            break<br><br>        # user 2<br>        choice = input("Please choose an empty space for O: ")<br>        choice = int(choice)<br>        if board[choice] == " ":<br>            board[choice] = "O"<br>        else:<br>            print("Spot already taken")<br>            time.sleep(1)<br>        # for user 2 to win<br>        if is_winner(board, "O"):<br>            os.system("clear")<br>            rules()<br>            print_board()<br>            print("USER2 Win")<br>            break<br><br>        # check if board is full i.e. a tie<br>        if is_board_full(board):<br>            print("Tie")<br>            break<br><br><br>def single_player():<br>    board = ["", " ", " ", " ", " ", " ", " ", " ", " ", " "]<br><br>    def rules():<br>        print("Welcome to TICTACTOE")<br>        print("This is a single player game where You are X and Computer is O")<br>        print("Enter your choice from 1 to 9")<br>        print("""<br>                1 | 2 | 3<br>                ---|---|---<br>                4 | 5 | 6<br>                ---|---|---<br>                7 | 8 | 9<br>                """)<br><br>    def print_board():<br>        print("   |   |   ")<br>        print(" "+board[1]+" | "+board[2]+" | "+board[3]+" ")<br>        print("   |   |   ")<br>        print("---|---|---")<br>        print("   |   |   ")<br>        print(" "+board[4]+" | "+board[5]+" | "+board[6]+" ")<br>        print("   |   |   ")<br>        print("---|---|---")<br>        print("   |   |   ")<br>        print(" "+board[7]+" | "+board[8]+" | "+board[9]+" ")<br>        print("   |   |   ")<br><br>    def is_winner(board, player):<br>        if (board[1] == player and board[2] == player and board[3] == player) or \<br>            (board[4] == player and board[5] == player and board[6] == player) or \<br>            (board[7] == player and board[8] == player and board[9] == player) or \<br>            (board[1] == player and board[4] == player and board[7] == player) or \<br>            (board[2] == player and board[5] == player and board[8] == player) or \<br>            (board[3] == player and board[6] == player and board[9] == player) or \<br>            (board[1] == player and board[5] == player and board[9] == player) or \<br>                (board[3] == player and board[5] == player and board[7] == player):<br>            return True<br>        else:<br>            return False<br><br>    def is_board_full(board):<br>        if " " in board:<br>            return False<br>        else:<br>            return True<br><br>    def get_computer_move(board, player):<br><br>        # check for a win<br>        for i in range(1, 10):<br>            if board[i] == " ":<br>                board[i] = player<br>                if is_winner(board, player):<br>                    return i<br>                else:<br>                    board[i] = " "<br><br>        # check for column block<br>        for i in [1, 2, 3]:<br>            if board[i] == "X" and board[i+3] == "X" and board[i+6] == " ":<br>                return i+6<br>            if board[i+3] == "X" and board[i+6] == "X" and board[i] == " ":<br>                return i<br>            if board[i] == "X" and board[i+6] == "X" and board[i+3] == " ":<br>                return i+3<br><br>        # check for rows blocks<br>        for i in [1, 4, 7]:<br>            if board[i] == "X" and board[i+1] == "X" and board[i+2] == " ":<br>                return i+2<br>            if board[i+1] == "X" and board[i+2] == "X" and board[i] == " ":<br>                return i<br>            if board[i] == "X" and board[i+2] == "X" and board[i+1] == " ":<br>                return i+1<br><br>        # check diagonal block<br>        if board[1] == "X" and board[5] == "X" and board[9] == " ":<br>            return 9<br>        if board[9] == "X" and board[5] == "X" and board[1] == " ":<br>            return 1<br>        if board[1] == "X" and board[9] == "X" and board[5] == " ":<br>            return 5<br>        if board[3] == "X" and board[5] == "X" and board[7] == " ":<br>            return 7<br>        if board[7] == "X" and board[5] == "X" and board[3] == " ":<br>            return 3<br>        if board[3] == "X" and board[7] == "X" and board[5] == " ":<br>            return 5<br><br>        if board[5] == " ":<br>            return 5<br>        while True:<br>            move = random.randint(1, 9)<br>            if board[move] == " ":<br>                return move<br>                break<br>            return 5<br><br>    while True:<br>        os.system("clear")<br>        rules()<br>        print_board()<br><br>        # user 1<br>        choice = input("Please choose an empty space for X: ")<br>        choice = int(choice)<br>        if board[choice] == " ":<br>            board[choice] = "X"<br>        else:<br>            print("Spot already taken")<br>            time.sleep(1)<br>        # for user 1 to win<br>        if is_winner(board, "X"):<br>            os.system("clear")<br>            rules()<br>            print_board()<br>            print("Congratulations!!You Win")<br>            break<br><br>        os.system("clear")<br>        rules()<br>        print_board()<br><br>        # check if board is full i.e. a tie<br>        if is_board_full(board):<br>            print("Tie")<br>            break<br><br>        # user 2<br>        choice = get_computer_move(board, "O")<br>        if board[choice] == " ":<br>            board[choice] = "O"<br>        else:<br>            print("Spot already taken")<br>            time.sleep(1)<br>        # for user 2 to win<br>        if is_winner(board, "O"):<br>            os.system("clear")<br>            rules()<br>            print_board()<br>            print("Sorry!!COMPUTER Wins")<br>            break<br><br>        # check if board is full i.e. a tie<br>        if is_board_full(board):<br>            print("Tie")<br>            break<br><br><br>welcome()<br>print("\n")<br>option()</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/10aeed6e7345e3c590a11bb7f880fc42/Screenshot_2020_11_18_152239.jpg" />
         <pubDate>2020-11-18 10:50:10 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936026043</guid>
      </item>
      <item>
         <title>Guess the Number</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936031583</link>
         <description><![CDATA[<div>from random import sample, shuffle<br><br>digits = 3<br>guesses = 10<br><br>print('I am thinking of a', digits, 'digit number.')<br>print('Try to guess what it is.')<br>print('Here are some clues:')<br>print('When I say:    That means:')<br>print('  pico         One digit is correct but in the wrong position.')<br>print('  fermi        One digit is correct and in the right position.')<br>print('  bagels       No digit is correct.')<br>print('There are no repeated digits in the number.')<br><br># Create a random number.<br><br>letters = sample('0123456789', digits)<br><br>if letters[0] == '0':<br>    letters.reverse()<br><br>number = ''.join(letters)<br><br>print('I have thought up a number.')<br>print('You have', guesses, 'guesses to get it.')<br><br>counter = 1<br><br>while True:<br>    print('Guess #', counter)<br>    guess = input()<br><br>    if len(guess) != digits:<br>        print('Wrong number of digits. Try again!')<br>        continue<br><br>    # Create the clues.<br><br>    clues = []<br><br>    for index in range(digits):<br>        if guess[index] == number[index]:<br>            clues.append('fermi')<br>        elif guess[index] in number:<br>            clues.append('pico')<br><br>    shuffle(clues)<br><br>    if len(clues) == 0:<br>        print('bagels')<br>    else:<br>        print(' '.join(clues))<br><br>    counter += 1<br><br>    if guess == number:<br>        print('You got it!')<br>        break<br><br>    if counter &gt; guesses:<br>        print('You ran out of guesses. The answer was', number)<br>        break<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/3148861b835a9258720ccf986eb5ce75/download.jpeg" />
         <pubDate>2020-11-18 10:52:17 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936031583</guid>
      </item>
      <item>
         <title>Guess the Word</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936037567</link>
         <description><![CDATA[<div># Python Program to illustrate  <br># Hangman Game <br>import random <br>from collections import Counter <br>  <br>someWords = '''apple banana mango strawberry  <br>orange grape pineapple apricot lemon coconut watermelon <br>cherry papaya berry peach lychee dragonfruit '''<br>  <br>someWords = someWords.split(' ') <br># randomly choose a secret word from our "someWords" LIST. <br>word = random.choice(someWords)          <br>  <br>if __name__ == '__main__': <br>    print('Guess the word! HINT: word is a name of a fruit') <br>      <br>    for i in word: <br>         # For printing the empty spaces for letters of the word <br>        print('_', end = ' ')         <br>    print() <br>  <br>    playing = True<br>     # list for storing the letters guessed by the player <br>    letterGuessed = ''                 <br>    chances = len(word) + 2<br>    correct = 0<br>    flag = 0<br>    try: <br>        while (chances != 0) and flag == 0: #flag is updated when the word is correctly guessed  <br>            print() <br>            chances -= 1<br>  <br>            try: <br>                guess = str(input('Enter a letter to guess: ')) <br>            except: <br>                print('Enter only a letter!') <br>                continue<br>  <br>            # Validation of the guess <br>            if not guess.isalpha(): <br>                print('Enter only a LETTER') <br>                continue<br>            elif len(guess) &gt; 1: <br>                print('Enter only a SINGLE letter') <br>                continue<br>            elif guess in letterGuessed: <br>                print('You have already guessed that letter') <br>                continue<br>  <br>  <br>            # If letter is guessed correctly <br>            if guess in word: <br>                k = word.count(guess) #k stores the number of times the guessed letter occurs in the word <br>                for _ in range(k):     <br>                    letterGuessed += guess # The guess letter is added as many times as it occurs <br>  <br>            # Print the word <br>            for char in word: <br>                if char in letterGuessed and (Counter(letterGuessed) != Counter(word)): <br>                    print(char, end = ' ') <br>                    correct += 1<br>                # If user has guessed all the letters <br>                elif (Counter(letterGuessed) == Counter(word)): # Once the correct word is guessed fully,  <br>                                                                # the game ends, even if chances remain <br>                    print("The word is: ", end=' ') <br>                    print(word) <br>                    flag = 1<br>                    print('Congratulations, You won!') <br>                    break # To break out of the for loop <br>                    break # To break out of the while loop <br>                else: <br>                    print('_', end = ' ') <br>  <br>              <br>  <br>        # If user has used all of his chances <br>        if chances &lt;= 0 and (Counter(letterGuessed) != Counter(word)): <br>            print() <br>            print('You lost! Try again..') <br>            print('The word was {}'.format(word)) <br>  <br>    except KeyboardInterrupt: <br>        print() <br>        print('Bye! Try again.') <br>        exit() </div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/60656de121da544389091f4dd8a05a10/download.jpeg" />
         <pubDate>2020-11-18 10:54:35 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936037567</guid>
      </item>
      <item>
         <title>Hangman</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936041624</link>
         <description><![CDATA[<div>#                                 Welcome to DataFlair Hangman Game:<br><br><br>import random<br>import time<br><br># Initial Steps to invite in the game:<br>print("\nWelcome to Hangman game ")<br>name = input("Enter your name: ")<br>print("Hello " + name + "! Best of Luck!")<br>time.sleep(2)<br>print("The game is about to start!\n Let's play Hangman!")<br>time.sleep(3)<br><br><br># The parameters we require to execute the game:<br>def main():<br>    global count<br>    global display<br>    global word<br>    global already_guessed<br>    global length<br>    global play_game<br>    words_to_guess = ["january","border","image","film","promise","kids","lungs","doll","rhyme","damage","plants","diary","encyclopedia","dictionary"]<br>    word = random.choice(words_to_guess)<br>    length = len(word)<br>    count = 0<br>    display = '_' * length<br>    already_guessed = []<br>    play_game = ""<br><br># A loop to re-execute the game when the first round ends:<br><br>def play_loop():<br>    global play_game<br>    play_game = input("Do You want to play again? y = yes, n = no \n")<br>    while play_game not in ["y", "n","Y","N"]:<br>        play_game = input("Do You want to play again? y = yes, n = no \n")<br>    if play_game == "y":<br>        main()<br>    elif play_game == "n":<br>        print("Thanks For Playing! We expect you back again!")<br>        exit()<br><br># Initializing all the conditions required for the game:<br>def hangman():<br>    global count<br>    global display<br>    global word<br>    global already_guessed<br>    global play_game<br>    limit = 5<br>    guess = input("This is the Hangman Word: " + display + " Enter your guess: \n")<br>    guess = guess.strip()<br>    if len(guess.strip()) == 0 or len(guess.strip()) &gt;= 2 or guess &lt;= "9":<br>        print("Invalid Input, Try a letter\n")<br>        hangman()<br><br><br>    elif guess in word:<br>        already_guessed.extend([guess])<br>        index = word.find(guess)<br>        word = word[:index] + "_" + word[index + 1:]<br>        display = display[:index] + guess + display[index + 1:]<br>        print(display + "\n")<br><br>    elif guess in already_guessed:<br>        print("Try another letter.\n")<br><br>    else:<br>        count += 1<br><br>        if count == 1:<br>            time.sleep(1)<br>            print("   _____ \n"<br>                  "  |      \n"<br>                  "  |      \n"<br>                  "  |      \n"<br>                  "  |      \n"<br>                  "  |      \n"<br>                  "  |      \n"<br>                  "_|__\n")<br>            print("Wrong guess. " + str(limit - count) + " guesses remaining\n")<br><br>        elif count == 2:<br>            time.sleep(1)<br>            print("   _____ \n"<br>                  "  |     | \n"<br>                  "  |     |\n"<br>                  "  |      \n"<br>                  "  |      \n"<br>                  "  |      \n"<br>                  "  |      \n"<br>                  "_|__\n")<br>            print("Wrong guess. " + str(limit - count) + " guesses remaining\n")<br><br>        elif count == 3:<br>           time.sleep(1)<br>           print("   _____ \n"<br>                 "  |     | \n"<br>                 "  |     |\n"<br>                 "  |     | \n"<br>                 "  |      \n"<br>                 "  |      \n"<br>                 "  |      \n"<br>                 "_|__\n")<br>           print("Wrong guess. " + str(limit - count) + " guesses remaining\n")<br><br>        elif count == 4:<br>            time.sleep(1)<br>            print("   _____ \n"<br>                  "  |     | \n"<br>                  "  |     |\n"<br>                  "  |     | \n"<br>                  "  |     O \n"<br>                  "  |      \n"<br>                  "  |      \n"<br>                  "_|__\n")<br>            print("Wrong guess. " + str(limit - count) + " last guess remaining\n")<br><br>        elif count == 5:<br>            time.sleep(1)<br>            print("   _____ \n"<br>                  "  |     | \n"<br>                  "  |     |\n"<br>                  "  |     | \n"<br>                  "  |     O \n"<br>                  "  |    /|\ \n"<br>                  "  |    / \ \n"<br>                  "_|__\n")<br>            print("Wrong guess. You are hanged!!!\n")<br>            print("The word was:",already_guessed,word)<br>            play_loop()<br><br>    if word == '_' * length:<br>        print("Congrats! You have guessed the word correctly!")<br>        play_loop()<br><br>    elif count != limit:<br>        hangman()<br><br><br>main()<br><br><br>hangman()<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/8109e8b38e92269aa38af30c9d231ec9/Screenshot_2020_11_18_152239.jpg" />
         <pubDate>2020-11-18 10:56:08 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936041624</guid>
      </item>
      <item>
         <title>Magic Ball 8</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936053782</link>
         <description><![CDATA[<div>import sys<br>import random<br><br>ans = True<br><br>while ans:<br>    question = input("Ask the magic 8 ball a question: (press enter to quit) :")<br>    <br>    answers = random.randint(1,8)<br>    <br>    if question == "":<br>        sys.exit()<br>    <br>    elif answers == 1:<br>        print ("It is certain")<br>    <br>    elif answers == 2:<br>        print ("Outlook good")<br>    <br>    elif answers == 3:<br>        print ("You may rely on it")<br>    <br>    elif answers == 4:<br>        print( "Ask again later")<br>    <br>    elif answers == 5:<br>        print ("Concentrate and ask again")<br>    <br>    elif answers == 6:<br>        print( "Reply hazy, try again")<br>    <br>    elif answers == 7:<br>        print ("My reply is no")<br>    <br>    elif answers == 8:<br>        print ("My sources say no")<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/7592eb780769bab4101920d999d3ffec/download.jpeg" />
         <pubDate>2020-11-18 11:01:03 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936053782</guid>
      </item>
      <item>
         <title>Pacman</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936058036</link>
         <description><![CDATA[from random import choice
from turtle import *
from freegames import floor, vector

state = {'score': 0}
path = Turtle(visible=False)
writer = Turtle(visible=False)
aim = vector(5, 0)
pacman = vector(-40, -80)
ghosts = [
    [vector(-180, 160), vector(5, 0)],
    [vector(-180, -160), vector(0, 5)],
    [vector(100, 160), vector(0, -5)],
    [vector(100, -160), vector(-5, 0)],
]
tiles = [
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
    0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
    0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0,
    0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0,
    0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
    0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,
    0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
    0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0,
    0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0,
    0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
    0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
    0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0,
    0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0,
    0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0,
    0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]

def square(x, y):
    "Draw square using path at (x, y)."
    path.up()
    path.goto(x, y)
    path.down()
    path.begin_fill()

    for count in range(4):
        path.forward(20)
        path.left(90)

    path.end_fill()

def offset(point):
    "Return offset of point in tiles."
    x = (floor(point.x, 20) + 200) / 20
    y = (180 - floor(point.y, 20)) / 20
    index = int(x + y * 20)
    return index

def valid(point):
    "Return True if point is valid in tiles."
    index = offset(point)

    if tiles[index] == 0:
        return False

    index = offset(point + 19)

    if tiles[index] == 0:
        return False

    return point.x % 20 == 0 or point.y % 20 == 0

def world():
    "Draw world using path."
    bgcolor('black')
    path.color('blue')

    for index in range(len(tiles)):
        tile = tiles[index]

        if tile &gt; 0:
            x = (index % 20) * 20 - 200
            y = 180 - (index // 20) * 20
            square(x, y)

            if tile == 1:
                path.up()
                path.goto(x + 10, y + 10)
                path.dot(2, 'white')

def move():
    "Move pacman and all ghosts."
    writer.undo()
    writer.write(state['score'])

    clear()

    if valid(pacman + aim):
        pacman.move(aim)

    index = offset(pacman)

    if tiles[index] == 1:
        tiles[index] = 2
        state['score'] += 1
        x = (index % 20) * 20 - 200
        y = 180 - (index // 20) * 20
        square(x, y)

    up()
    goto(pacman.x + 10, pacman.y + 10)
    dot(20, 'yellow')

    for point, course in ghosts:
        if valid(point + course):
            point.move(course)
        else:
            options = [
                vector(5, 0),
                vector(-5, 0),
                vector(0, 5),
                vector(0, -5),
            ]
            plan = choice(options)
            course.x = plan.x
            course.y = plan.y

        up()
        goto(point.x + 10, point.y + 10)
        dot(20, 'red')

    update()

    for point, course in ghosts:
        if abs(pacman - point) &lt; 20:
            return

    ontimer(move, 100)

def change(x, y):
    "Change pacman aim if valid."
    if valid(pacman + vector(x, y)):
        aim.x = x
        aim.y = y

setup(420, 420, 370, 0)
hideturtle()
tracer(False)
writer.goto(160, 160)
writer.color('white')
writer.write(state['score'])
listen()
onkey(lambda: change(5, 0), 'Right')
onkey(lambda: change(-5, 0), 'Left')
onkey(lambda: change(0, 5), 'Up')
onkey(lambda: change(0, -5), 'Down')
world()
move()
done()]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/87cd217e7a26ebb0b769b48bf9121dc9/images.png" />
         <pubDate>2020-11-18 11:02:49 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936058036</guid>
      </item>
      <item>
         <title>Pig Latern</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936064714</link>
         <description><![CDATA[<div>#Take the users input<br>words =input("Enter some text to translate to pig latin: ")<br>print( "You entered: "), words<br><br>#Now I need to break apart the words into a list<br>words = words.split(' ')<br><br>#Now words is a list, so I can manipulate each one usinga loop<br><br>for i in words:<br>    if len(i) &gt;= 3: #I only want to translate words greater than 3 characters<br>        i = i + "%say" % (i[0]) <br>        i = i[1:]<br>        print(i)<br>    else:<br>        pass<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/dc3cff2a449b9acb7cfdb3c4326d1dca/download.jpeg" />
         <pubDate>2020-11-18 11:05:31 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936064714</guid>
      </item>
      <item>
         <title>Platform Runner</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936071798</link>
         <description><![CDATA[<div>import pygame<br><br># Global constants<br><br># Colors<br>BLACK    = (   0,   0,   0)<br>WHITE    = ( 255, 255, 255)<br>BLUE     = (   0,   0, 255)<br>RED      = ( 255,   0,   0)<br>GREEN    = (   0, 255,   0)<br><br># Screen dimensions<br>SCREEN_WIDTH  = 800<br>SCREEN_HEIGHT = 600<br><br>class Player(pygame.sprite.Sprite):<br>    """<br>    This class represents the bar at the bottom that the player controls.<br>    """<br><br>    # -- Methods<br>    def __init__(self):<br>        """ Constructor function """<br><br>        # Call the parent's constructor<br>        super().__init__()<br><br>        # Create an image of the block, and fill it with a color.<br>        # This could also be an image loaded from the disk.<br>        width = 40<br>        height = 60<br>        self.image = pygame.Surface([width, height])<br>        self.image.fill(RED)<br><br>        # Set a referance to the image rect.<br>        self.rect = self.image.get_rect()<br><br>        # Set speed vector of player<br>        self.change_x = 0<br>        self.change_y = 0<br><br>        # List of sprites we can bump against<br>        self.level = None<br><br><br>    def update(self):<br>        """ Move the player. """<br>        # Gravity<br>        self.calc_grav()<br><br>        # Move left/right<br>        self.rect.x += self.change_x<br><br>        # See if we hit anything<br>        block_hit_list = pygame.sprite.spritecollide(self, self.level.platform_list, False)<br>        for block in block_hit_list:<br>            # If we are moving right,<br>            # set our right side to the left side of the item we hit<br>            if self.change_x &gt; 0:<br>                self.rect.right = block.rect.left<br>            elif self.change_x &lt; 0:<br>                # Otherwise if we are moving left, do the opposite.<br>                self.rect.left = block.rect.right<br><br>        # Move up/down<br>        self.rect.y += self.change_y<br><br>        # Check and see if we hit anything<br>        block_hit_list = pygame.sprite.spritecollide(self, self.level.platform_list, False)<br>        for block in block_hit_list:<br><br>            # Reset our position based on the top/bottom of the object.<br>            if self.change_y &gt; 0:<br>                self.rect.bottom = block.rect.top<br>            elif self.change_y &lt; 0:<br>                self.rect.top = block.rect.bottom<br><br>            # Stop our vertical movement<br>            self.change_y = 0<br><br>            if isinstance(block, MovingPlatform):<br>                self.rect.x += block.change_x<br><br>    def calc_grav(self):<br>        """ Calculate effect of gravity. """<br>        if self.change_y == 0:<br>            self.change_y = 1<br>        else:<br>            self.change_y += .35<br><br>        # See if we are on the ground.<br>        if self.rect.y &gt;= SCREEN_HEIGHT - self.rect.height and self.change_y &gt;= 0:<br>            self.change_y = 0<br>            self.rect.y = SCREEN_HEIGHT - self.rect.height<br><br>    def jump(self):<br>        """ Called when user hits 'jump' button. """<br><br>        # move down a bit and see if there is a platform below us.<br>        # Move down 2 pixels because it doesn't work well if we only move down 1<br>        # when working with a platform moving down.<br>        self.rect.y += 2<br>        platform_hit_list = pygame.sprite.spritecollide(self, self.level.platform_list, False)<br>        self.rect.y -= 2<br><br>        # If it is ok to jump, set our speed upwards<br>        if len(platform_hit_list) &gt; 0 or self.rect.bottom &gt;= SCREEN_HEIGHT:<br>            self.change_y = -10<br><br>    # Player-controlled movement:<br>    def go_left(self):<br>        """ Called when the user hits the left arrow. """<br>        self.change_x = -6<br><br>    def go_right(self):<br>        """ Called when the user hits the right arrow. """<br>        self.change_x = 6<br><br>    def stop(self):<br>        """ Called when the user lets off the keyboard. """<br>        self.change_x = 0<br><br>class Platform(pygame.sprite.Sprite):<br>    """ Platform the user can jump on """<br><br>    def __init__(self, width, height):<br>        """ Platform constructor. Assumes constructed with user passing in<br>            an array of 5 numbers like what's defined at the top of this code.<br>            """<br>        super().__init__()<br><br>        self.image = pygame.Surface([width, height])<br>        self.image.fill(GREEN)<br><br>        self.rect = self.image.get_rect()<br><br><br>class MovingPlatform(Platform):<br>    """ This is a fancier platform that can actually move. """<br>    change_x = 0<br>    change_y = 0<br><br>    boundary_top = 0<br>    boundary_bottom = 0<br>    boundary_left = 0<br>    boundary_right = 0<br><br>    player = None<br><br>    level = None<br><br>    def update(self):<br>        """ Move the platform.<br>            If the player is in the way, it will shove the player<br>            out of the way. This does NOT handle what happens if a<br>            platform shoves a player into another object. Make sure<br>            moving platforms have clearance to push the player around<br>            or add code to handle what happens if they don't. """<br><br>        # Move left/right<br>        self.rect.x += self.change_x<br><br>        # See if we hit the player<br>        hit = pygame.sprite.collide_rect(self, self.player)<br>        if hit:<br>            # We did hit the player. Shove the player around and<br>            # assume he/she won't hit anything else.<br><br>            # If we are moving right, set our right side<br>            # to the left side of the item we hit<br>            if self.change_x &lt; 0:<br>                self.player.rect.right = self.rect.left<br>            else:<br>                # Otherwise if we are moving left, do the opposite.<br>                self.player.rect.left = self.rect.right<br><br>        # Move up/down<br>        self.rect.y += self.change_y<br><br>        # Check and see if we the player<br>        hit = pygame.sprite.collide_rect(self, self.player)<br>        if hit:<br>            # We did hit the player. Shove the player around and<br>            # assume he/she won't hit anything else.<br><br>            # Reset our position based on the top/bottom of the object.<br>            if self.change_y &lt; 0:<br>                self.player.rect.bottom = self.rect.top<br>            else:<br>                self.player.rect.top = self.rect.bottom<br><br>        # Check the boundaries and see if we need to reverse<br>        # direction.<br>        if self.rect.bottom &gt; self.boundary_bottom or self.rect.top &lt; self.boundary_top:<br>            self.change_y *= -1<br><br>        cur_pos = self.rect.x - self.level.world_shift<br>        if cur_pos &lt; self.boundary_left or cur_pos &gt; self.boundary_right:<br>            self.change_x *= -1<br><br>class Level(object):<br>    """ This is a generic super-class used to define a level.<br>        Create a child class for each level with level-specific<br>        info. """<br><br>    # Lists of sprites used in all levels. Add or remove<br>    # lists as needed for your game.<br>    platform_list = None<br>    enemy_list = None<br><br>    # Background image<br>    background = None<br><br>    # How far this world has been scrolled left/right<br>    world_shift = 0<br>    level_limit = -1000<br><br>    def __init__(self, player):<br>        """ Constructor. Pass in a handle to player. Needed for when moving<br>            platforms collide with the player. """<br>        self.platform_list = pygame.sprite.Group()<br>        self.enemy_list = pygame.sprite.Group()<br>        self.player = player<br><br>    # Update everythign on this level<br>    def update(self):<br>        """ Update everything in this level."""<br>        self.platform_list.update()<br>        self.enemy_list.update()<br><br>    def draw(self, screen):<br>        """ Draw everything on this level. """<br><br>        # Draw the background<br>        screen.fill(BLUE)<br><br>        # Draw all the sprite lists that we have<br>        self.platform_list.draw(screen)<br>        self.enemy_list.draw(screen)<br><br>    def shift_world(self, shift_x):<br>        """ When the user moves left/right and we need to scroll everything:<br>        """<br><br>        # Keep track of the shift amount<br>        self.world_shift += shift_x<br><br>        # Go through all the sprite lists and shift<br>        for platform in self.platform_list:<br>            platform.rect.x += shift_x<br><br>        for enemy in self.enemy_list:<br>            enemy.rect.x += shift_x<br><br># Create platforms for the level<br>class Level_01(Level):<br>    """ Definition for level 1. """<br><br>    def __init__(self, player):<br>        """ Create level 1. """<br><br>        # Call the parent constructor<br>        Level.__init__(self, player)<br><br>        self.level_limit = -1500<br><br>        # Array with width, height, x, and y of platform<br>        level = [[210, 70, 500, 500],<br>                 [210, 70, 800, 400],<br>                 [210, 70, 1000, 500],<br>                 [210, 70, 1120, 280],<br>                 ]<br><br><br>        # Go through the array above and add platforms<br>        for platform in level:<br>            block = Platform(platform[0], platform[1])<br>            block.rect.x = platform[2]<br>            block.rect.y = platform[3]<br>            block.player = self.player<br>            self.platform_list.add(block)<br><br>        # Add a custom moving platform<br>        block = MovingPlatform(70, 40)<br>        block.rect.x = 1350<br>        block.rect.y = 280<br>        block.boundary_left = 1350<br>        block.boundary_right = 1600<br>        block.change_x = 1<br>        block.player = self.player<br>        block.level = self<br>        self.platform_list.add(block)<br><br><br># Create platforms for the level<br>class Level_02(Level):<br>    """ Definition for level 2. """<br><br>    def __init__(self, player):<br>        """ Create level 1. """<br><br>        # Call the parent constructor<br>        Level.__init__(self, player)<br><br>        self.level_limit = -1000<br><br>        # Array with type of platform, and x, y location of the platform.<br>        level = [[210, 70, 500, 550],<br>                 [210, 70, 800, 400],<br>                 [210, 70, 1000, 500],<br>                 [210, 70, 1120, 280],<br>                 ]<br><br><br>        # Go through the array above and add platforms<br>        for platform in level:<br>            block = Platform(platform[0], platform[1])<br>            block.rect.x = platform[2]<br>            block.rect.y = platform[3]<br>            block.player = self.player<br>            self.platform_list.add(block)<br><br>        # Add a custom moving platform<br>        block = MovingPlatform(70, 70)<br>        block.rect.x = 1500<br>        block.rect.y = 300<br>        block.boundary_top = 100<br>        block.boundary_bottom = 550<br>        block.change_y = -1<br>        block.player = self.player<br>        block.level = self<br>        self.platform_list.add(block)<br><br>def main():<br>    """ Main Program """<br>    pygame.init()<br><br>    # Set the height and width of the screen<br>    size = [SCREEN_WIDTH, SCREEN_HEIGHT]<br>    screen = pygame.display.set_mode(size)<br><br>    pygame.display.set_caption("Platformer with moving platforms")<br><br>    # Create the player<br>    player = Player()<br><br>    # Create all the levels<br>    level_list = []<br>    level_list.append(Level_01(player))<br>    level_list.append(Level_02(player))<br><br>    # Set the current level<br>    current_level_no = 0<br>    current_level = level_list[current_level_no]<br><br>    active_sprite_list = pygame.sprite.Group()<br>    player.level = current_level<br><br>    player.rect.x = 340<br>    player.rect.y = SCREEN_HEIGHT - player.rect.height<br>    active_sprite_list.add(player)<br><br>    #Loop until the user clicks the close button.<br>    done = False<br><br>    # Used to manage how fast the screen updates<br>    clock = pygame.time.Clock()<br><br>    # -------- Main Program Loop -----------<br>    while not done:<br>        for event in pygame.event.get(): # User did something<br>            if event.type == pygame.QUIT: # If user clicked close<br>                done = True # Flag that we are done so we exit this loop<br><br>            if event.type == pygame.KEYDOWN:<br>                if event.key == pygame.K_LEFT:<br>                    player.go_left()<br>                if event.key == pygame.K_RIGHT:<br>                    player.go_right()<br>                if event.key == pygame.K_UP:<br>                    player.jump()<br><br>            if event.type == pygame.KEYUP:<br>                if event.key == pygame.K_LEFT and player.change_x &lt; 0:<br>                    player.stop()<br>                if event.key == pygame.K_RIGHT and player.change_x &gt; 0:<br>                    player.stop()<br><br>        # Update the player.<br>        active_sprite_list.update()<br><br>        # Update items in the level<br>        current_level.update()<br><br>        # If the player gets near the right side, shift the world left (-x)<br>        if player.rect.right &gt;= 500:<br>            diff = player.rect.right - 500<br>            player.rect.right = 500<br>            current_level.shift_world(-diff)<br> <br>        # If the player gets near the left side, shift the world right (+x)<br>        if player.rect.left &lt;= 120:<br>            diff = 120 - player.rect.left<br>            player.rect.left = 120<br>            current_level.shift_world(diff)<br>            <br>        # If the player gets to the end of the level, go to the next level<br>        current_position = player.rect.x + current_level.world_shift<br>        if current_position &lt; current_level.level_limit:<br>            if current_level_no &lt; len(level_list)-1:<br>                player.rect.x = 120<br>                current_level_no += 1<br>                current_level = level_list[current_level_no]<br>                player.level = current_level<br>            else:<br>                # Out of levels. This just exits the program.<br>                # You'll want to do something better.<br>                done = True<br><br>        # ALL CODE TO DRAW SHOULD GO BELOW THIS COMMENT<br>        current_level.draw(screen)<br>        active_sprite_list.draw(screen)<br><br>        # ALL CODE TO DRAW SHOULD GO ABOVE THIS COMMENT<br><br>        # Limit to 60 frames per second<br>        clock.tick(60)<br><br>        # Go ahead and update the screen with what we've drawn.<br>        pygame.display.flip()<br><br>    # Be IDLE friendly. If you forget this line, the program will 'hang'<br>    # on exit.<br>    pygame.quit()<br><br>if __name__ == "__main__":<br>    main()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/7f9b049c32c65a8840e188d8f1a7022d/images.png" />
         <pubDate>2020-11-18 11:08:09 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936071798</guid>
      </item>
      <item>
         <title>Pong</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936080388</link>
         <description><![CDATA[from random import choice, random
from turtle import *
from freegames import vector

def value():
    "Randomly generate value between (-5, -3) or (3, 5)."
    return (3 + random() * 2) * choice([1, -1])

ball = vector(0, 0)
aim = vector(value(), value())
state = {1: 0, 2: 0}

def move(player, change):
    "Move player position by change."
    state[player] += change

def rectangle(x, y, width, height):
    "Draw rectangle at (x, y) with given width and height."
    up()
    goto(x, y)
    down()
    begin_fill()
    for count in range(2):
        forward(width)
        left(90)
        forward(height)
        left(90)
    end_fill()

def draw():
    "Draw game and move pong ball."
    clear()
    rectangle(-200, state[1], 10, 50)
    rectangle(190, state[2], 10, 50)

    ball.move(aim)
    x = ball.x
    y = ball.y

    up()
    goto(x, y)
    dot(10)
    update()

    if y &lt; -200 or y &gt; 200:
        aim.y = -aim.y

    if x &lt; -185:
        low = state[1]
        high = state[1] + 50

        if low &lt;= y &lt;= high:
            aim.x = -aim.x
        else:
            return

    if x &gt; 185:
        low = state[2]
        high = state[2] + 50

        if low &lt;= y &lt;= high:
            aim.x = -aim.x
        else:
            return

    ontimer(draw, 50)

setup(420, 420, 370, 0)
hideturtle()
tracer(False)
listen()
onkey(lambda: move(1, 20), 'w')
onkey(lambda: move(1, -20), 's')
onkey(lambda: move(2, 20), 'i')
onkey(lambda: move(2, -20), 'k')
draw()
done()

]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/9d5ef759c82adb61d71805692a999d01/download.png" />
         <pubDate>2020-11-18 11:11:34 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936080388</guid>
      </item>
      <item>
         <title>Puzzle</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936084209</link>
         <description><![CDATA[<div>from random import *<br>from turtle import *<br>from freegames import floor, vector<br><br>tiles = {}<br>neighbors = [<br>    vector(100, 0),<br>    vector(-100, 0),<br>    vector(0, 100),<br>    vector(0, -100),<br>]<br><br>def load():<br>    "Load tiles and scramble."<br>    count = 1<br><br>    for y in range(-200, 200, 100):<br>        for x in range(-200, 200, 100):<br>            mark = vector(x, y)<br>            tiles[mark] = count<br>            count += 1<br><br>    tiles[mark] = None<br><br>    for count in range(1000):<br>        neighbor = choice(neighbors)<br>        spot = mark + neighbor<br><br>        if spot in tiles:<br>            number = tiles[spot]<br>            tiles[spot] = None<br>            tiles[mark] = number<br>            mark = spot<br><br>def square(mark, number):<br>    "Draw white square with black outline and number."<br>    up()<br>    goto(mark.x, mark.y)<br>    down()<br><br>    color('black', 'white')<br>    begin_fill()<br>    for count in range(4):<br>        forward(99)<br>        left(90)<br>    end_fill()<br><br>    if number is None:<br>        return<br>    elif number &lt; 10:<br>        forward(20)<br><br>    write(number, font=('Arial', 60, 'normal'))<br><br>def tap(x, y):<br>    "Swap tile and empty square."<br>    x = floor(x, 100)<br>    y = floor(y, 100)<br>    mark = vector(x, y)<br><br>    for neighbor in neighbors:<br>        spot = mark + neighbor<br><br>        if spot in tiles and tiles[spot] is None:<br>            number = tiles[mark]<br>            tiles[spot] = number<br>            square(spot, number)<br>            tiles[mark] = None<br>            square(mark, None)<br><br>def draw():<br>    "Draw all tiles."<br>    for mark in tiles:<br>        square(mark, tiles[mark])<br>    update()<br><br>setup(420, 420, 370, 0)<br>hideturtle()<br>tracer(False)<br>load()<br>draw()<br>onscreenclick(tap)<br>done()</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/e1a5d16f0c12ba82a9e121d055200cff/download.jpeg" />
         <pubDate>2020-11-18 11:13:08 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936084209</guid>
      </item>
      <item>
         <title>Snake Game</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936102946</link>
         <description><![CDATA[<div>import pygame<br>import time<br>import random<br> <br>pygame.init()<br> <br>white = (255, 255, 255)<br>yellow = (255, 255, 102)<br>black = (0, 0, 0)<br>red = (213, 50, 80)<br>green = (0, 255, 0)<br>blue = (50, 153, 213)<br> <br>dis_width = 600<br>dis_height = 400<br> <br>dis = pygame.display.set_mode((dis_width, dis_height))<br>pygame.display.set_caption('Snake Game by Sarang')<br> <br>clock = pygame.time.Clock()<br> <br>snake_block = 10<br>snake_speed = 15<br> <br>font_style = pygame.font.SysFont("bahnschrift", 25)<br>score_font = pygame.font.SysFont("comicsansms", 35)<br> <br> <br>def Your_score(score):<br>    value = score_font.render("Your Score: " + str(score), True, yellow)<br>    dis.blit(value, [0, 0])<br> <br> <br> <br>def our_snake(snake_block, snake_list):<br>    for x in snake_list:<br>        pygame.draw.rect(dis, red, [x[0], x[1], snake_block, snake_block])<br> <br> <br>def message(msg, color):<br>    mesg = font_style.render(msg, True, color)<br>    dis.blit(mesg, [dis_width / 6, dis_height / 3])<br> <br> <br>def gameLoop():<br>    game_over = False<br>    game_close = False<br> <br>    x1 = dis_width / 2<br>    y1 = dis_height / 2<br> <br>    x1_change = 0<br>    y1_change = 0<br> <br>    snake_List = []<br>    Length_of_snake = 1<br> <br>    foodx = round(random.randrange(0, dis_width - snake_block) / 10.0) * 10.0<br>    foody = round(random.randrange(0, dis_height - snake_block) / 10.0) * 10.0<br> <br>    while not game_over:<br> <br>        while game_close == True:<br>            dis.fill(black)<br>            message("Try Again! Press C-Play Again or Q-Quit", red)<br>            Your_score(Length_of_snake - 1)<br>            pygame.display.update()<br> <br>            for event in pygame.event.get():<br>                if event.type == pygame.KEYDOWN:<br>                    if event.key == pygame.K_q:<br>                        game_over = True<br>                        game_close = False<br>                    if event.key == pygame.K_c:<br>                        gameLoop()<br> <br>        for event in pygame.event.get():<br>            if event.type == pygame.QUIT:<br>                game_over = True<br>            if event.type == pygame.KEYDOWN:<br>                if event.key == pygame.K_LEFT:<br>                    x1_change = -snake_block<br>                    y1_change = 0<br>                elif event.key == pygame.K_RIGHT:<br>                    x1_change = snake_block<br>                    y1_change = 0<br>                elif event.key == pygame.K_UP:<br>                    y1_change = -snake_block<br>                    x1_change = 0<br>                elif event.key == pygame.K_DOWN:<br>                    y1_change = snake_block<br>                    x1_change = 0<br> <br>        if x1 &gt;= dis_width or x1 &lt; 0 or y1 &gt;= dis_height or y1 &lt; 0:<br>            game_close = True<br>        x1 += x1_change<br>        y1 += y1_change<br>        dis.fill(black)<br>        pygame.draw.rect(dis, white, [foodx, foody, snake_block, snake_block])<br>        snake_Head = []<br>        snake_Head.append(x1)<br>        snake_Head.append(y1)<br>        snake_List.append(snake_Head)<br>        if len(snake_List) &gt; Length_of_snake:<br>            del snake_List[0]<br> <br>        for x in snake_List[:-1]:<br>            if x == snake_Head:<br>                game_close = True<br> <br>        our_snake(snake_block, snake_List)<br>        Your_score(Length_of_snake - 1)<br> <br>        pygame.display.update()<br> <br>        if x1 == foodx and y1 == foody:<br>            foodx = round(random.randrange(0, dis_width - snake_block) / 10.0) * 10.0<br>            foody = round(random.randrange(0, dis_height - snake_block) / 10.0) * 10.0<br>            Length_of_snake += 1<br> <br>        clock.tick(snake_speed)<br> <br>    pygame.quit()<br>    quit()<br> <br> <br>gameLoop()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/540c046636e16ab1f5dcb739b68fc20b/download.png" />
         <pubDate>2020-11-18 11:20:34 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936102946</guid>
      </item>
      <item>
         <title>Tic Tac Toe</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936107283</link>
         <description><![CDATA[<div># --------- Global Variables -----------<br><br># Will hold our game board data<br>board = ["-", "-", "-",<br>         "-", "-", "-",<br>         "-", "-", "-"]<br><br># Lets us know if the game is over yet<br>game_still_going = True<br><br># Tells us who the winner is<br>winner = None<br><br># Tells us who the current player is (X goes first)<br>current_player = "X"<br><br><br># ------------- Functions ---------------<br><br># Play a game of tic tac toe<br>def play_game():<br><br>  # Show the initial game board<br>  display_board()<br><br>  # Loop until the game stops (winner or tie)<br>  while game_still_going:<br><br>    # Handle a turn<br>    handle_turn(current_player)<br><br>    # Check if the game is over<br>    check_if_game_over()<br><br>    # Flip to the other player<br>    flip_player()<br>  <br>  # Since the game is over, print the winner or tie<br>  if winner == "X" or winner == "O":<br>    print(winner + " won.")<br>  elif winner == None:<br>    print("Tie.")<br><br><br># Display the game board to the screen<br>def display_board():<br>  print("\n")<br>  print(board[0] + " | " + board[1] + " | " + board[2] + "     1 | 2 | 3")<br>  print(board[3] + " | " + board[4] + " | " + board[5] + "     4 | 5 | 6")<br>  print(board[6] + " | " + board[7] + " | " + board[8] + "     7 | 8 | 9")<br>  print("\n")<br><br><br># Handle a turn for an arbitrary player<br>def handle_turn(player):<br><br>  # Get position from player<br>  print(player + "'s turn.")<br>  position = input("Choose a position from 1-9: ")<br><br>  # Whatever the user inputs, make sure it is a valid input, and the spot is open<br>  valid = False<br>  while not valid:<br><br>    # Make sure the input is valid<br>    while position not in ["1", "2", "3", "4", "5", "6", "7", "8", "9"]:<br>      position = input("Choose a position from 1-9: ")<br> <br>    # Get correct index in our board list<br>    position = int(position) - 1<br><br>    # Then also make sure the spot is available on the board<br>    if board[position] == "-":<br>      valid = True<br>    else:<br>      print("You can't go there. Go again.")<br><br>  # Put the game piece on the board<br>  board[position] = player<br><br>  # Show the game board<br>  display_board()<br><br><br># Check if the game is over<br>def check_if_game_over():<br>  check_for_winner()<br>  check_for_tie()<br><br><br># Check to see if somebody has won<br>def check_for_winner():<br>  # Set global variables<br>  global winner<br>  # Check if there was a winner anywhere<br>  row_winner = check_rows()<br>  column_winner = check_columns()<br>  diagonal_winner = check_diagonals()<br>  # Get the winner<br>  if row_winner:<br>    winner = row_winner<br>  elif column_winner:<br>    winner = column_winner<br>  elif diagonal_winner:<br>    winner = diagonal_winner<br>  else:<br>    winner = None<br><br><br># Check the rows for a win<br>def check_rows():<br>  # Set global variables<br>  global game_still_going<br>  # Check if any of the rows have all the same value (and is not empty)<br>  row_1 = board[0] == board[1] == board[2] != "-"<br>  row_2 = board[3] == board[4] == board[5] != "-"<br>  row_3 = board[6] == board[7] == board[8] != "-"<br>  # If any row does have a match, flag that there is a win<br>  if row_1 or row_2 or row_3:<br>    game_still_going = False<br>  # Return the winner<br>  if row_1:<br>    return board[0] <br>  elif row_2:<br>    return board[3] <br>  elif row_3:<br>    return board[6] <br>  # Or return None if there was no winner<br>  else:<br>    return None<br><br><br># Check the columns for a win<br>def check_columns():<br>  # Set global variables<br>  global game_still_going<br>  # Check if any of the columns have all the same value (and is not empty)<br>  column_1 = board[0] == board[3] == board[6] != "-"<br>  column_2 = board[1] == board[4] == board[7] != "-"<br>  column_3 = board[2] == board[5] == board[8] != "-"<br>  # If any row does have a match, flag that there is a win<br>  if column_1 or column_2 or column_3:<br>    game_still_going = False<br>  # Return the winner<br>  if column_1:<br>    return board[0] <br>  elif column_2:<br>    return board[1] <br>  elif column_3:<br>    return board[2] <br>  # Or return None if there was no winner<br>  else:<br>    return None<br><br><br># Check the diagonals for a win<br>def check_diagonals():<br>  # Set global variables<br>  global game_still_going<br>  # Check if any of the columns have all the same value (and is not empty)<br>  diagonal_1 = board[0] == board[4] == board[8] != "-"<br>  diagonal_2 = board[2] == board[4] == board[6] != "-"<br>  # If any row does have a match, flag that there is a win<br>  if diagonal_1 or diagonal_2:<br>    game_still_going = False<br>  # Return the winner<br>  if diagonal_1:<br>    return board[0] <br>  elif diagonal_2:<br>    return board[2]<br>  # Or return None if there was no winner<br>  else:<br>    return None<br><br><br># Check if there is a tie<br>def check_for_tie():<br>  # Set global variables<br>  global game_still_going<br>  # If board is full<br>  if "-" not in board:<br>    game_still_going = False<br>    return True<br>  # Else there is no tie<br>  else:<br>    return False<br><br><br># Flip the current player from X to O, or O to X<br>def flip_player():<br>  # Global variables we need<br>  global current_player<br>  # If the current player was X, make it O<br>  if current_player == "X":<br>    current_player = "O"<br>  # Or if the current player was O, make it X<br>  elif current_player == "O":<br>    current_player = "X"<br><br><br># ------------ Start Execution -------------<br># Play a game of tic tac toe<br>play_game()<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/697620ade1c675aeb9288a89a1cb14c0/images.jpeg" />
         <pubDate>2020-11-18 11:22:19 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936107283</guid>
      </item>
      <item>
         <title>Tresure Finding Number</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936113767</link>
         <description><![CDATA[<div>import math<br>import random<br>import tkinter<br> <br>def odd(n):<br>    return n &amp; 1<br> <br>def color(a):<br>    return 'green' if odd(a) else 'blue'<br> <br>class Map:<br> <br>    def __init__(self, master, rows = 15, columns = 60):<br>        self.master = master<br>        self.row = random.randrange(rows)<br>        self.col = random.randrange(columns)<br>        self.cost = 0<br>        self.found = False<br>        Button = tkinter.Button<br>        self.buttons = []<br>        options = dict(text = '??', font = 'Courier 14')<br>        for r in range(rows):<br>            br = []                 # row of buttons<br>            self.buttons.append(br)<br>            for c in range(columns):<br>                b = Button(<br>                    master,<br>                    command = lambda r=r, c=c: self(r, c),<br>                    fg = color(r+c),<br>                    **options<br>                    )<br>                b.grid(row = r, column = c)<br>                br.append(b)<br>        master.mainloop()<br> <br>    def __bool__(self):<br>        return self.found<br> <br>    def __call__(self, row, col):<br>        if self:<br>            self.master.quit()<br>        distance = int(round(math.hypot(row-self.row, col-self.col)))<br>        self.buttons[row][col].configure(text = '{}'.format(distance), bg = 'yellow', fg = 'red')<br>        self.cost += 1<br>        if not distance:<br>            print('You win!  At the cost of {} sonar devices.'.format(self.cost))<br>            self.found = True<br> <br>def main():<br>    root = tkinter.Tk()<br>    map = Map(root)<br>    root.destroy()<br> <br>if __name__ == '__main__':<br>    main()</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/4f82555f5f97e02d7b46e07bf5c730b3/download.jpeg" />
         <pubDate>2020-11-18 11:24:53 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936113767</guid>
      </item>
      <item>
         <title>Cute Alien Run</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936123274</link>
         <description><![CDATA[<div>import pygame<br><br>import constants<br>import levels<br><br>from player import Player<br><br>def main():<br>    """ Main Program """<br>    pygame.init()<br><br>    # Set the height and width of the screen<br>    size = [constants.SCREEN_WIDTH, constants.SCREEN_HEIGHT]<br>    screen = pygame.display.set_mode(size)<br><br>    pygame.display.set_caption("Platformer with sprite sheets")<br><br>    # Create the player<br>    player = Player()<br><br>    # Create all the levels<br>    level_list = []<br>    level_list.append(levels.Level_01(player))<br>    level_list.append(levels.Level_02(player))<br><br>    # Set the current level<br>    current_level_no = 0<br>    current_level = level_list[current_level_no]<br><br>    active_sprite_list = pygame.sprite.Group()<br>    player.level = current_level<br><br>    player.rect.x = 340<br>    player.rect.y = constants.SCREEN_HEIGHT - player.rect.height<br>    active_sprite_list.add(player)<br><br>    #Loop until the user clicks the close button.<br>    done = False<br><br>    # Used to manage how fast the screen updates<br>    clock = pygame.time.Clock()<br><br>    # -------- Main Program Loop -----------<br>    while not done:<br>        for event in pygame.event.get(): # User did something<br>            if event.type == pygame.QUIT: # If user clicked close<br>                done = True # Flag that we are done so we exit this loop<br><br>            if event.type == pygame.KEYDOWN:<br>                if event.key == pygame.K_LEFT:<br>                    player.go_left()<br>                if event.key == pygame.K_RIGHT:<br>                    player.go_right()<br>                if event.key == pygame.K_UP:<br>                    player.jump()<br><br>            if event.type == pygame.KEYUP:<br>                if event.key == pygame.K_LEFT and player.change_x &lt; 0:<br>                    player.stop()<br>                if event.key == pygame.K_RIGHT and player.change_x &gt; 0:<br>                    player.stop()<br><br>        # Update the player.<br>        active_sprite_list.update()<br><br>        # Update items in the level<br>        current_level.update()<br><br>        # If the player gets near the right side, shift the world left (-x)<br>        if player.rect.right &gt;= 500:<br>            diff = player.rect.right - 500<br>            player.rect.right = 500<br>            current_level.shift_world(-diff)<br> <br>        # If the player gets near the left side, shift the world right (+x)<br>        if player.rect.left &lt;= 120:<br>            diff = 120 - player.rect.left<br>            player.rect.left = 120<br>            current_level.shift_world(diff)<br><br>        # If the player gets to the end of the level, go to the next level<br>        current_position = player.rect.x + current_level.world_shift<br>        if current_position &lt; current_level.level_limit:<br>            player.rect.x = 120<br>            if current_level_no &lt; len(level_list)-1:<br>                current_level_no += 1<br>                current_level = level_list[current_level_no]<br>                player.level = current_level<br><br>        # ALL CODE TO DRAW SHOULD GO BELOW THIS COMMENT<br>        current_level.draw(screen)<br>        active_sprite_list.draw(screen)<br><br>        # ALL CODE TO DRAW SHOULD GO ABOVE THIS COMMENT<br><br>        # Limit to 60 frames per second<br>        clock.tick(60)<br><br>        # Go ahead and update the screen with what we've drawn.<br>        pygame.display.flip()<br><br>    # Be IDLE friendly. If you forget this line, the program will 'hang'<br>    # on exit.<br>    pygame.quit()<br><br>if __name__ == "__main__":<br>    main()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/a8d838143c1cb4f8df12526bd7fa253b/download.jpeg" />
         <pubDate>2020-11-18 11:28:56 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936123274</guid>
      </item>
      <item>
         <title>Ludo</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936126629</link>
         <description><![CDATA[<div>File 1 (__.init__.py)<br>File2 (cli.py)<br>from .game import Player, Game<br>from .painter import present_6_die_name<br>from .recorder import RunRecord, MakeRecord<br>from os import linesep<br><br><br>class CLIGame():<br><br>    def __init__(self):<br>        self.prompt_end = "&gt; "<br>        self.game = Game()<br>        # used for nicer print<br>        self.prompted_for_pawn = False<br>        # saving game data<br>        self.record_maker = MakeRecord()<br>        # getting game data<br>        self.record_runner = None<br><br>    def validate_input(self, prompt, desire_type, allawed_input=None,<br>                       error_mess="Invalid Option!", str_len=None):<br>        '''<br>        loop while receive correct value<br>        param allowed_input can be list of allowed values<br>        param str_len is two sized tuple if min and max<br>        '''<br>        prompt += linesep + self.prompt_end<br>        while True:<br>            choice = input(prompt)<br>            if not choice:<br>                print(linesep + error_mess)<br>                continue<br>            try:<br>                choice = desire_type(choice)<br>            except ValueError:<br>                print(linesep + error_mess)<br>                continue<br>            if allawed_input:<br>                if choice in allawed_input:<br>                    break<br>                else:<br>                    print("Invalid Option!")<br>                    continue<br>            elif str_len:<br>                min_len, max_len = str_len<br>                if min_len &lt; len(choice) &lt; max_len:<br>                    break<br>                else:<br>                    print(linesep + error_mess)<br>            else:<br>                break<br>        print()<br>        return choice<br><br>    def get_user_initial_choice(self):<br>        text = linesep.join(["choose option",<br>                             "0 - start new game",<br>                             "1 - continue game",<br>                             "2 - run (review) recorded game"])<br>        choice = self.validate_input(text, int, (0, 1, 2))<br>        return choice<br><br>    def prompt_for_file(self, mode="rb"):<br>        '''return file descriptor'''<br>        text = "Enter filename (name of the record)"<br>        while True:<br>            filename = self.validate_input(text, str)<br>            try:<br>                file_descr = open(filename, mode=mode)<br>                return file_descr<br>            except IOError as e:<br>                print(e)<br>                print("Try again")<br><br>    def does_user_want_save_game(self):<br>        '''return True if user want to save<br>        game or False<br>        '''<br>        text = linesep.join(["Save game?",<br>                             "0 - No",<br>                             "1 - Yes"])<br>        choice = self.validate_input(text, int, (0, 1))<br>        return choice == 1<br><br>    def prompt_for_player(self):<br>        ''' get player attributes from input,<br>        initial player instance and<br>        add player to the game<br>        '''<br>        available_colours = self.game.get_available_colours()<br>        text = linesep.join(["choose type of player",<br>                             "0 - computer",<br>                             "1 - human"])<br>        choice = self.validate_input(text, int, (0, 1))<br><br>        if choice == 1:<br>            name = self.validate_input("Enter name for player",<br>                                       str, str_len=(1, 30))<br>            available_options = range(len(available_colours))<br>            if len(available_options) &gt; 1:<br>                # show available colours<br>                options = ["{} - {}".format(index, colour)<br>                           for index, colour in<br>                           zip(available_options,<br>                           available_colours)]<br>                text = "choose colour" + linesep<br>                text += linesep.join(options)<br>                choice = self.validate_input(text, int, available_options)<br>                colour = available_colours.pop(choice)<br>            else:<br>                # only one colour left<br>                colour = available_colours.pop()<br>            player = Player(colour, name, self.prompt_choose_pawn)<br>        elif choice == 0:<br>            # automatically assign colours<br>            colour = available_colours.pop()<br>            player = Player(colour)<br>        self.game.add_palyer(player)<br><br>    def prompt_for_players(self):<br>        '''put all players in the game'''<br>        counts = ("first", "second", "third", "fourth last")<br>        text_add = "Add {} player"<br>        for i in range(2):<br>            print(text_add.format(counts[i]))<br>            self.prompt_for_player()<br>            print("Player added")<br><br>        text = linesep.join(["Choose option:",<br>                             "0 - add player",<br>                             "1 - start game with {} players"])<br>        for i in range(2, 4):<br>            choice = self.validate_input(text.format(str(i)), int, (0, 1))<br>            if choice == 1:<br>                break<br>            elif choice == 0:<br>                print(text_add.format(counts[i]))<br>                self.prompt_for_player()<br>                print("Player added")<br><br>    def prompt_choose_pawn(self):<br>        '''used when player (human) has more than<br>        one possible pawn to move.<br>        This method is pass as a callable during<br>        player instantiation<br>        '''<br>        text = present_6_die_name(self.game.rolled_value,<br>                                  str(self.game.curr_player))<br>        text += linesep + "has more than one possible pawns to move."<br>        text += " Choose pawn" + linesep<br>        pawn_options = ["{} - {}".format(index + 1, pawn.id)<br>                        for index, pawn<br>                        in enumerate(self.game.allowed_pawns)]<br>        text += linesep.join(pawn_options)<br>        index = self.validate_input(<br>            text, int, range(1, len(self.game.allowed_pawns) + 1))<br>        self.prompted_for_pawn = True<br>        return index - 1<br><br>    def prompt_to_continue(self):<br>        text = "press Enter to continue" + linesep<br>        input(text)<br><br>    def print_players_info(self):<br>        word = "start" if self.game.rolled_value is None else "continue"<br>        print("Game {} with {} players:".format(<br>              word,<br>              len(self.game.players)))<br>        for player in self.game.players:<br>            print(player)<br>        print()<br><br>    def print_info_after_turn(self):<br>        '''it used game attributes to print info'''<br>        pawns_id = [pawn.id for pawn in self.game.allowed_pawns]<br>        # nicer print of dice<br>        message = present_6_die_name(self.game.rolled_value,<br>                                     str(self.game.curr_player))<br>        message += linesep<br>        if self.game.allowed_pawns:<br>            message_moved = "{} is moved. ".format(<br>                self.game.picked_pawn.id)<br>            if self.prompted_for_pawn:<br>                self.prompted_for_pawn = False<br>                print(message_moved)<br>                return<br>            message += "{} possible pawns to move.".format(<br>                " ".join(pawns_id))<br>            message += " " + message_moved<br>            if self.game.jog_pawns:<br>                message += "Jog pawn "<br>                message += " ".join([pawn.id for pawn in self.game.jog_pawns])<br>        else:<br>            message += "No possible pawns to move."<br>        print(message)<br><br>    def print_standing(self):<br>        standing_list = ["{} - {}".format(index + 1, player)<br>                         for index, player in enumerate(self.game.standing)]<br>        message = "Standing:" + linesep + linesep.join(standing_list)<br>        print(message)<br><br>    def print_board(self):<br>        print(self.game.get_board_pic())<br><br>    def run_recorded_game(self):<br>        '''get history of game (rolled_value<br>        and  index's allowed pawn) from <br>        record_runner in order to replay game'''<br>        self.load_recorded_players()<br>        self.print_players_info()<br>        self.prompt_to_continue()<br>        for rolled_value, index in self.record_runner:<br>            self.game.play_turn(index, rolled_value)<br>            self.print_info_after_turn()<br>            self.print_board()<br>            self.prompt_to_continue()<br>            self.print_board()<br><br>    def continue_recorded_game(self):<br>        '''move forward the game by calling <br>        play_turn method to the moment <br>        where game was interrupted. <br>        '''<br>        self.load_recorded_players()<br>        self.record_players()<br>        for rolled_value, index in self.record_runner:<br>            self.game.play_turn(index, rolled_value)<br>            self.record_maker.add_game_turn(<br>                self.game.rolled_value, self.game.index)<br>        self.print_players_info()<br>        self.print_info_after_turn()<br>        self.print_board()<br><br>    def record_players(self):<br>        '''save players on recorder'''<br>        for player in self.game.players:<br>            self.record_maker.add_player(player)<br><br>    def load_recorded_players(self):<br>        '''get recorded (save) players from<br>        recorder and put them in game<br>        '''<br>        if self.record_runner is None:<br>            file_descr = self.prompt_for_file()<br>            self.record_runner = RunRecord(file_descr)<br>            file_descr.close()<br>        for player in self.record_runner.get_players(<br>                self.prompt_choose_pawn):<br>            self.game.add_palyer(player)<br><br>    def load_players_for_new_game(self):<br>        self.prompt_for_players()<br>        self.print_players_info()<br>        self.record_players()<br><br>    def play_game(self):<br>        '''mainly calling play_turn<br>        Game's method while game finished<br>        '''<br>        try:<br>            while not self.game.finished:<br>                self.game.play_turn()<br>                self.print_info_after_turn()<br>                self.print_board()<br>                self.record_maker.add_game_turn(<br>                    self.game.rolled_value, self.game.index)<br>                self.prompt_to_continue()<br>            print("Game finished")<br>            self.print_standing()<br>            self.offer_save_game()<br>        except (KeyboardInterrupt, EOFError):<br>            print(linesep +<br>                  "Exiting game. " +<br>                  "Save game and continue same game later?")<br>            self.offer_save_game()<br>            raise<br><br>    def offer_save_game(self):<br>        '''offer user save game'''<br>        if self.does_user_want_save_game():<br>            file_descr = self.prompt_for_file(mode="wb")<br>            self.record_maker.save(file_descr)<br>            file_descr.close()<br>            print("Game is saved")<br><br>    def start(self):<br>        '''main method, starting cli'''<br>        print()<br>        try:<br>            choice = self.get_user_initial_choice()<br>            if choice == 0:  # start new game<br>                self.load_players_for_new_game()<br>                self.play_game()<br>            elif choice == 1:  # continue game<br>                self.continue_recorded_game()<br>                if self.game.finished:<br>                    print("Could not continue.",<br>                          "Game is already finished",<br>                          linesep + "Exit")<br>                else:<br>                    self.prompt_to_continue()<br>                    self.play_game()<br>            elif choice == 2:  # review played game<br>                self.run_recorded_game()<br>        except (KeyboardInterrupt, EOFError):<br>            print(linesep + "Exit Game")<br><br><br>if __name__ == '__main__':<br>    CLIGame().start()<br><br>File 3 (game.py)<br>from collections import namedtuple, deque<br>import random<br>from .painter import PaintBoard<br><br># Thanks to Angel Angelov<br># This is piece or a token in ludo game<br># Simple class has only index, colour and id attributes<br>Pawn = namedtuple("Pawn", "index colour id")<br><br><br>class Player():<br>    '''Knows (holds) his pawns,<br>     also know his colour<br>    and choose which pawn to move<br>    if more than one are possible<br>    '''<br>    def __init__(self, colour, name=None, choose_pawn_delegate=None):<br>        '''choose_pawn_delegate is callable.<br>        if choose_pawn_delegate is not None it is called<br>        with argument list of available pawns to move<br>        and expect chosen index from this list<br>        if it is None (means computer) random index is chosen<br>        '''<br>        self.colour = colour<br>        self.choose_pawn_delegate = choose_pawn_delegate<br>        self.name = name<br>        if self.name is None and self.choose_pawn_delegate is None:<br>            self.name = "computer"<br>        self.finished = False<br>        # initialize four pawns with<br>        # id (first leter from colour and index (from 1 to 4))<br>        self.pawns = [Pawn(i, colour, colour[0].upper() + str(i))<br>                      for i in range(1, 5)]<br><br>    def __str__(self):<br>        return "{}({})".format(self.name, self.colour)<br><br>    def choose_pawn(self, pawns):<br>        '''Delegate choice to choose_pawn_delegate func attribute<br>        if it is not None<br>        '''<br>        if len(pawns) == 1:<br>            index = 0<br>        elif len(pawns) &gt; 1:<br>            if self.choose_pawn_delegate is None:<br>                index = random.randint(0, len(pawns) - 1)<br>            else:<br>                index = self.choose_pawn_delegate()<br>        return index<br><br><br>class Board():<br>    '''<br>    Knows where are pawns.<br>    Pawns are assigned with position numbers.<br>    Can move (change position number) pawn.<br>    Knows other things like<br>    what distance pawn must past to reach end.<br>    It just board. It does not know rules of the game.<br>    '''<br><br>    # common (shared) squares for all pawns<br>    BOARD_SIZE = 56<br><br>    # save (private) positions (squares) for each colour<br>    # This is squares just before pawn finished<br>    BOARD_COLOUR_SIZE = 7<br><br>    COLOUR_ORDER = ['yellow', 'blue', 'red', 'green']<br><br>    # distance between two neighbour colours<br>    # (The distance from start square of one colour<br>    # to start square of next colour)<br>    COLOUR_DISTANCE = 14<br><br>    def __init__(self):<br>        #fn1353c<br>        # get dict of start position for every colour<br>        Board.COLOUR_START = {<br>            colour: 1 + index * Board.COLOUR_DISTANCE for<br>            index, colour in enumerate(Board.COLOUR_ORDER)}<br>        # get dict of end position for every colour<br>        Board.COLOUR_END = {<br>            colour: index * Board.COLOUR_DISTANCE<br>            for index, colour in enumerate(Board.COLOUR_ORDER)}<br>        Board.COLOUR_END['yellow'] = Board.BOARD_SIZE<br><br>        # dict where key is pawn and<br>        # value is two size tuple holds position<br>        # Position is combination of<br>        # common (share) square and coloured (private) square.<br>        self.pawns_possiotion = {}<br><br>        # painter is used to visually represent<br>        # the board and position of the pawns<br>        self.painter = PaintBoard()<br><br>        # pool means before start1353<br>        self.board_pool_position = (0, 0)<br><br>    def set_pawn(self, pawn, position):<br>        '''save position'''<br>        self.pawns_possiotion[pawn] = position<br><br>    def put_pawn_on_board_pool(self, pawn):<br>        self.set_pawn(pawn, self.board_pool_position)<br><br>    def is_pawn_on_board_pool(self, pawn):<br>        '''return True of False'''<br>        return self.pawns_possiotion[pawn] == self.board_pool_position<br><br>    def put_pawn_on_starting_square(self, pawn):<br>        start = Board.COLOUR_START[pawn.colour.lower()]<br>        position = (start, 0)<br>        self.set_pawn(pawn, position)<br><br>    def can_pawn_move(self, pawn, rolled_value):<br>        '''check if pawn can outside board colour size'''<br>        common_poss, private_poss = self.pawns_possiotion[pawn]<br>        if private_poss + rolled_value &gt; self.BOARD_COLOUR_SIZE:<br>            return False<br>        return True<br><br>    def move_pawn(self, pawn, rolled_value):<br>        '''change pawn position, check<br>        if pawn reach his color square<br>        '''<br>        common_poss, private_poss = self.pawns_possiotion[pawn]<br>        end = self.COLOUR_END[pawn.colour.lower()]<br>        if private_poss &gt; 0:<br>            # pawn is already reached own final squares<br>            private_poss += rolled_value<br>        elif common_poss &lt;= end and common_poss + rolled_value &gt; end:<br>            # pawn is entering in own squares<br>            private_poss += rolled_value - (end - common_poss)<br>            common_poss = end<br>        else:<br>            # pawn will be still in common square<br>            common_poss += rolled_value<br>            if common_poss &gt; self.BOARD_SIZE:<br>                common_poss = common_poss - self.BOARD_SIZE<br>        position = common_poss, private_poss<br>        self.set_pawn(pawn, position)<br><br>    def does_pawn_reach_end(self, pawn):<br>        '''if pawn must leave game'''<br>        common_poss, private_poss = self.pawns_possiotion[pawn]<br>        if private_poss == self.BOARD_COLOUR_SIZE:<br>            return True<br>        return False<br><br>    def get_pawns_on_same_postion(self, pawn):<br>        '''return list of pawns on same position'''<br>        position = self.pawns_possiotion[pawn]<br>        return [curr_pawn for curr_pawn, curr_postion in<br>                self.pawns_possiotion.items()<br>                if position == curr_postion]<br><br>    def paint_board(self):<br>        '''painter object expect dict of<br>        key - occupied positions and<br>        value - list of pawns on that position<br>        '''<br>        positions = {}<br>        for pawn, position in self.pawns_possiotion.items():<br>            common, private = position<br>            if not private == Board.BOARD_COLOUR_SIZE:<br>                positions.setdefault(position, []).append(pawn)<br>        return self.painter.paint(positions)<br><br><br>class Die():<br><br>    MIN = 1<br>    MAX = 6<br><br>    @staticmethod<br>    def throw():<br>        return random.randint(Die.MIN, Die.MAX)<br><br><br>class Game():<br>    '''Knows the rules of the game.<br>    Knows for example what to do when <br>    one pawn reach another<br>    or pawn reach end or <br>    player roll six and so on<br>    '''<br><br>    def __init__(self):<br>        self.players = deque()<br>        self.standing = []<br>        self.board = Board()<br>        # is game finished<br>        self.finished = False<br>        # last rolled value from die (dice)<br>        self.rolled_value = None<br>        # player who last rolled die<br>        self.curr_player = None<br>        # curr_player's possible pawn to move<br>        self.allowed_pawns = []<br>        # curr_player's chosen pawn to move<br>        self.picked_pawn = None<br>        # chosen index from allowed pawn <br>        self.index = None<br>        # jog pawn if any <br>        self.jog_pawns = []<br><br>    def add_palyer(self, player):<br>        self.players.append(player)<br>        for pawn in player.pawns:<br>            self.board.put_pawn_on_board_pool(pawn)<br><br>    def get_available_colours(self):<br>        '''if has available colour on boards'''<br>        used = [player.colour for player in self.players]<br>        available = set(self.board.COLOUR_ORDER) - set(used)<br>        return sorted(available)<br><br>    def _get_next_turn(self):<br>        '''Get next player's turn.<br>        It is underscore because if called <br>        outside the class will break order<br>        '''<br>        if not self.rolled_value == Die.MAX:<br>            self.players.rotate(-1)<br>        return self.players[0]<br><br>    def get_pawn_from_board_pool(self, player):<br>        '''when pawn must start'''<br>        for pawn in player.pawns:<br>            if self.board.is_pawn_on_board_pool(pawn):<br>                return pawn<br><br>    def get_allowed_pawns_to_move(self, player, rolled_value):<br>        ''' return all pawns of a player which rolled value<br>        from die allowed to move the pawn<br>        '''<br>        allowed_pawns = []<br>        if rolled_value == Die.MAX:<br>            pawn = self.get_pawn_from_board_pool(player)<br>            if pawn:<br>                allowed_pawns.append(pawn)<br>        for pawn in player.pawns:<br>            if not self.board.is_pawn_on_board_pool(pawn) and\<br>                    self.board.can_pawn_move(pawn, rolled_value):<br>                allowed_pawns.append(pawn)<br>        return sorted(allowed_pawns, key=lambda pawn: pawn.index)<br><br>    def get_board_pic(self):<br>        return self.board.paint_board()<br><br>    def _jog_foreign_pawn(self, pawn):<br>        pawns = self.board.get_pawns_on_same_postion(pawn)<br>        for p in pawns:<br>            if p.colour != pawn.colour:<br>                self.board.put_pawn_on_board_pool(p)<br>                self.jog_pawns.append(p)<br><br>    def _make_move(self, player, pawn):<br>        '''tell the board to move pawn.<br>        After move ask board if pawn reach end or<br>        jog others pawn. Check if pawn and player finished.<br>        '''<br>        if self.rolled_value == Die.MAX and\<br>                self.board.is_pawn_on_board_pool(pawn):<br>            self.board.put_pawn_on_starting_square(pawn)<br>            self._jog_foreign_pawn(pawn)<br>            return<br>        self.board.move_pawn(pawn, self.rolled_value)<br>        if self.board.does_pawn_reach_end(pawn):<br>            player.pawns.remove(pawn)<br>            if not player.pawns:<br>                self.standing.append(player)<br>                self.players.remove(player)<br>                if len(self.players) == 1:<br>                    self.standing.extend(self.players)<br>                    self.finished = True<br>        else:<br>            self._jog_foreign_pawn(pawn)<br><br>    def play_turn(self, ind=None, rolled_val=None):<br>        '''this is main method which must be used to play game.<br>        Method ask for next player's turn, roll die, ask player<br>        to choose pawn, move pawn.<br>        ind and rolled_val are suitable to be used when<br>        game must be replicated (recorded)<br>        ind is chosen index from allowed pawns<br>        '''<br>        self.jog_pawns = []<br>        self.curr_player = self._get_next_turn()<br>        if rolled_val is None:<br>            self.rolled_value = Die.throw()<br>        else:<br>            self.rolled_value = rolled_val<br>        self.allowed_pawns = self.get_allowed_pawns_to_move(<br>            self.curr_player, self.rolled_value)<br>        if self.allowed_pawns:<br>            if ind is None:<br>                self.index = self.curr_player.choose_pawn(<br>                    self.allowed_pawns)<br>            else:<br>                self.index = ind<br>            self.picked_pawn = self.allowed_pawns[self.index]<br>            self._make_move(self.curr_player, self.picked_pawn)<br>        else:<br>            self.index = -1<br>            self.picked_pawn = None<br><br>File 4 Painter<br>from copy import deepcopy<br>from os import linesep<br><br><br># board template (matrix)<br>BOARD_TMPL = [['#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '#', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', 'E', 'L', 'L', 'O', 'W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', ' ', 'V', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', 'L', 'U', 'E', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', '-', '-', '&gt;', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#'], ['#', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '#'], ['#', '-', '-', '-', '-', '-', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '-', '-', '-', '-', '-', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '-', '-', '-', '-', '-', '#'], ['#', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', 'X', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '#'], ['#', '-', '-', '-', '-', '-', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '-', '-', '-', '-', '-', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '-', '-', '-', '-', '-', '#'], ['#', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '#'], ['#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&lt;', '-', '-', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'G', 'R', 'E', 'E', 'N', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'R', 'E', 'D', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '^', ' ', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', '-', '-', '-', '-', '-', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', '#', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'], ['#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#']]<br><br># List of two sized tuples. The content of tuple correspond<br># with address of matrix BOARD_TMPL. While list index correspond<br># with pawn share position from board class<br>CODE_COMMON_SQUARES = [<br>    (),  # 0 index not used<br>    (14, 2), (14, 8), (14, 14), (14, 20), (14, 26), (14, 32), (14, 38),<br>    (12, 38), (10, 38), (8, 38), (6, 38), (4, 38), (2, 38), (2, 44),<br>    (2, 50), (4, 50), (6, 50), (8, 50), (10, 50), (12, 50), (14, 50),<br>    (14, 56), (14, 62), (14, 68), (14, 74), (14, 80), (14, 86), (16, 86),<br>    (18, 86), (18, 80), (18, 74), (18, 68), (18, 62), (18, 56), (18, 50),<br>    (20, 50), (22, 50), (24, 50), (26, 50), (28, 50), (30, 50), (30, 44),<br>    (30, 38), (28, 38), (26, 38), (24, 38), (22, 38), (20, 38), (18, 38),<br>    (18, 32), (18, 26), (18, 20), (18, 14), (18, 8), (18, 2), (16, 2)<br>]<br><br># tuple correspond with address of matrix BOARD_TMPL<br># color correspond to pawn colour<br># index of colour's list correspond with pawn private (final) position<br>CODE_COLOUR_SQUARES = {<br>    'yellow': [(), (16, 8), (16, 14), (16, 20), (16, 26), (16, 32), (16, 38)],<br>    'blue': [(), (4, 44), (6, 44), (8, 44), (10, 44), (12, 44), (14, 44)],<br>    'red': [(), (16, 80), (16, 74), (16, 68), (16, 62), (16, 56), (16, 50)],<br>    'green': [(), (28, 44), (26, 44), (24, 44), (22, 44), (20, 44), (18, 44)]<br>}<br><br># tuple correspond with address of matrix BOARD_TMPL<br># color correspond to pawn colour<br># index of colour's list correspond with pawn initial position<br>CODE_POOL_PLACES = {<br>    'yellow': [(), (6, 14), (6, 19), (8, 14), (8, 19)],<br>    'blue': [(), (6, 71), (6, 76), (8, 71), (8, 76)],<br>    'red': [(), (24, 71), (24, 76), (26, 71), (26, 76)],<br>    'green': [(), (24, 14), (24, 19), (26, 14), (26, 19)]<br>}<br><br><br>class PaintBoard():<br><br>    def __init__(self):<br>        self.board_tmpl_curr = deepcopy(BOARD_TMPL)<br><br>    def _place_pawn(self, pawn, position, offset):<br>        common_poss, private_poss = position<br>        colour = pawn.colour.lower()<br>        if private_poss &gt; 0:<br>            # private squares<br>            row, column = CODE_COLOUR_SQUARES[colour][private_poss]<br>        elif common_poss == 0:<br>            # pool <br>            row, column = CODE_POOL_PLACES[colour][pawn.index]<br>            offset = 0  # we do not need from offset in the pool only in squares <br>        else:<br>            # common squares<br>            row, column = CODE_COMMON_SQUARES[common_poss]<br>        if offset &gt; 0:<br>            self.board_tmpl_curr[row - 1][column + offset] = pawn.id[1]<br>        else:<br>            self.board_tmpl_curr[row - 1][column - 1] = pawn.id[0]<br>            self.board_tmpl_curr[row - 1][column] = pawn.id[1]<br><br>    def _place_pawns(self, position_pawns):<br>        for position, pawns in position_pawns.items():<br>            for index, pawn in enumerate(pawns):<br>                self._place_pawn(pawn, position, index)<br><br>    def paint(self, position):<br>        '''expect dict of<br>        key - occupied positions and<br>        value - list of pawns on that position<br>        '''<br>        self.board_tmpl_curr = deepcopy(BOARD_TMPL)<br>        self._place_pawns(position)<br>        board_paint = [''.join(row_list) for row_list in self.board_tmpl_curr]<br>        board_paint_str = linesep.join(board_paint)<br>        return board_paint_str<br><br><br>def present_6_die_name(number, name):<br>    '''nicer print of die and<br>    name of the player<br>    '''<br>    hor_line = 9 * '-'<br>    sps = 37 * ' '<br>    hor_line = sps + hor_line<br>    matrix = [['|       |', '|   #   |', '|       |'],<br>              ['|       |', '| #   # |', '|       |'],<br>              ['|     # |', '|   #   |', '| #     |'],<br>              ['| #   # |', '|       |', '| #   # |'],<br>              ['| #   # |', '|   #   |', '| #   # |'],<br>              ['| # # # |', '|       |', '| # # # |']]<br>    matrix = [[sps + cell for cell in row] for row in matrix]<br>    die = matrix[number - 1]<br>    die[1] = die[1] + "   " + name<br>    s = linesep.join([hor_line] + die + [hor_line])<br>    return s<br><br>File 5 recorder<br>import pickle<br>from .game import Player<br><br><br>class RunRecord():<br>    '''provide recoded game data<br>    iterating over instance<br>    yield rolled_value and index<br>    '''<br><br>    def __init__(self, file_obj):<br>        self.file_obj = file_obj<br>        data = pickle.load(self.file_obj)<br>        self.players = data[0]<br>        self.game_history = data[1]<br><br>    def get_players(self, func=None):<br>        '''<br>        return Player object<br>        recreated from a list<br>        func is callable which player<br>        may need for choice delegation<br>        '''<br>        res = []<br>        for colour, name, is_computer in self.players:<br>            if is_computer:<br>                player = Player(colour)<br>            else:<br>                player = Player(colour, name, func)<br>            res.append(player)<br>        return res<br><br>    def get_game_history(self):<br>        return self.game_history<br><br>    def __iter__(self):<br>        return iter(self.game_history)<br><br><br>class MakeRecord():<br>    '''save game data<br>    as a nested list which is<br>    saved with pickle<br>    '''<br><br>    def __init__(self):<br>        self.players = []<br>        self.game_history = []<br><br>    def add_player(self, player_obj):<br>        '''Accept Player object and<br>        it save NOT as object rather as a list<br>        '''<br>        if player_obj.choose_pawn_delegate is None:<br>            is_computer = True<br>        else:<br>            is_computer = False<br>        self.players.append((player_obj.colour,<br>                             player_obj.name, is_computer))<br><br>    def add_game_turn(self, rolled_value, index):<br>        self.game_history.append((rolled_value, index))<br><br>    def save(self, file_obj):<br>        '''list of lists with players and<br>        game history<br>        '''<br>        pickle.dump([self.players, self.game_history],<br>                    file_obj)<br><br>* *SAVE THEM IN LUDO FILE**<br>Create a new python file name it as run and type the following code<br>from ludo.cli import CLIGame<br><br><br>CLIGame().start()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/dc1f8b2e80e2276e5f742b47633782ba/download.jpeg" />
         <pubDate>2020-11-18 11:30:21 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/936126629</guid>
      </item>
      <item>
         <title>Please Do Visit This Page 👆</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/939954038</link>
         <description><![CDATA[<blockquote><a href="https://padlet.com/sarangsnair1621/Bookmarks"><strong><em>LEARN SHARE &amp; CODE </em></strong></a><strong><em><br></em></strong><br></blockquote>]]></description>
         <enclosure url="https://padlet.com/padlets/mqk3fj6nv0djfmbk" />
         <pubDate>2020-11-19 05:52:27 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/939954038</guid>
      </item>
      <item>
         <title>Passwod Cracker</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546783455</link>
         <description><![CDATA[<div># importing random<br>from random import *<br><br># taking input from user<br>user_pass = input("Enter your password")<br><br># storing alphabet letter to use thm to crack password<br>password = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j','k',&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't','u','v',&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'w', 'x', 'y', 'z',]<br><br># initializing an empty string<br>guess = ""<br><br><br># using while loop to generate many passwords untill one of<br># them does not matches user_pass<br>while (guess != user_pass):<br>&nbsp; &nbsp; guess = ""<br>&nbsp; &nbsp; # generating random passwords using for loop<br>&nbsp; &nbsp; for letter in range(len(user_pass)):<br>&nbsp; &nbsp; &nbsp; &nbsp; guess_letter = password[randint(0, 25)]<br>&nbsp; &nbsp; &nbsp; &nbsp; guess = str(guess_letter) + str(guess)<br>&nbsp; &nbsp; # printing guessed passwords<br>&nbsp; &nbsp; print(guess)<br>&nbsp; &nbsp;&nbsp;<br># printing the matched password<br>print("Your password is",guess)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/7b2564d99254b79330a5f6be2bf3c27d/download.jpeg" />
         <pubDate>2021-05-21 06:01:16 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546783455</guid>
      </item>
      <item>
         <title>Youtube Downloader Application</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546788842</link>
         <description><![CDATA[<div># importing random<br>from random import *<br><br># taking input from user<br>user_pass = input("Enter your password")<br><br># storing alphabet letter to use thm to crack password<br>password = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j','k',&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't','u','v',&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'w', 'x', 'y', 'z',]<br><br># initializing an empty string<br>guess = ""<br><br><br># using while loop to generate many passwords untill one of<br># them does not matches user_pass<br>while (guess != user_pass):<br>&nbsp; &nbsp; guess = ""<br>&nbsp; &nbsp; # generating random passwords using for loop<br>&nbsp; &nbsp; for letter in range(len(user_pass)):<br>&nbsp; &nbsp; &nbsp; &nbsp; guess_letter = password[randint(0, 25)]<br>&nbsp; &nbsp; &nbsp; &nbsp; guess = str(guess_letter) + str(guess)<br>&nbsp; &nbsp; # printing guessed passwords<br>&nbsp; &nbsp; print(guess)<br>&nbsp; &nbsp;&nbsp;<br># printing the matched password<br>print("Your password is",guess)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/3bfc40e84518b76119e626c9719e9844/download__1_.jpeg" />
         <pubDate>2021-05-21 06:04:20 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546788842</guid>
      </item>
      <item>
         <title>Covid Graph Application</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546793673</link>
         <description><![CDATA[<div># importing random<br>from random import *<br><br># taking input from user<br>user_pass = input("Enter your password")<br><br># storing alphabet letter to use thm to crack password<br>password = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j','k',&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't','u','v',&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'w', 'x', 'y', 'z',]<br><br># initializing an empty string<br>guess = ""<br><br><br># using while loop to generate many passwords untill one of<br># them does not matches user_pass<br>while (guess != user_pass):<br>&nbsp; &nbsp; guess = ""<br>&nbsp; &nbsp; # generating random passwords using for loop<br>&nbsp; &nbsp; for letter in range(len(user_pass)):<br>&nbsp; &nbsp; &nbsp; &nbsp; guess_letter = password[randint(0, 25)]<br>&nbsp; &nbsp; &nbsp; &nbsp; guess = str(guess_letter) + str(guess)<br>&nbsp; &nbsp; # printing guessed passwords<br>&nbsp; &nbsp; print(guess)<br>&nbsp; &nbsp;&nbsp;<br># printing the matched password<br>print("Your password is",guess)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/77c8505dfb35f2ca84a6bdeab4fb3488/download.png" />
         <pubDate>2021-05-21 06:06:27 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546793673</guid>
      </item>
      <item>
         <title>Login Form</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546797957</link>
         <description><![CDATA[<div># importing random<br>from random import *<br><br># taking input from user<br>user_pass = input("Enter your password")<br><br># storing alphabet letter to use thm to crack password<br>password = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j','k',&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't','u','v',&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'w', 'x', 'y', 'z',]<br><br># initializing an empty string<br>guess = ""<br><br><br># using while loop to generate many passwords untill one of<br># them does not matches user_pass<br>while (guess != user_pass):<br>&nbsp; &nbsp; guess = ""<br>&nbsp; &nbsp; # generating random passwords using for loop<br>&nbsp; &nbsp; for letter in range(len(user_pass)):<br>&nbsp; &nbsp; &nbsp; &nbsp; guess_letter = password[randint(0, 25)]<br>&nbsp; &nbsp; &nbsp; &nbsp; guess = str(guess_letter) + str(guess)<br>&nbsp; &nbsp; # printing guessed passwords<br>&nbsp; &nbsp; print(guess)<br>&nbsp; &nbsp;&nbsp;<br># printing the matched password<br>print("Your password is",guess)<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/e1eceb8bbb7c90b23eacfb89fe7d48df/download__1_.png" />
         <pubDate>2021-05-21 06:08:35 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546797957</guid>
      </item>
      <item>
         <title>OTP Generator</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546800053</link>
         <description><![CDATA[<div>'''In this tutorial are going to make a real-time GUI to Send OTP Using Python. For this project, we are going to use four modules namely Tkinter, Requests, Random, and JSON.<br>Tkinter will be used for creating the UI.<br>Requests will be used to send a GET request to the site.<br>JSON will be used for setting the parameters and the random module will be used for generating the OTP.<br>Also, you need to create an account on fast2sms. Creating an account is very simple. Go to http://www.fast2sms.com and create an account for free. As a new user, you will receive 50 rupees balance in your wallet.<br>Now Goto Dev API and generate your API. Copy your unique API and paste in the JSON part of the code.'''<br><br>from tkinter import *<br>import tkinter.messagebox as tsmg<br>import requests<br>import random<br>import json<br><br>root=Tk()<br><br>rand=random.randint(1,999999)<br><br>msg=f"Your One Time Password(OTP) is {rand}"<br><br>def sms_send(a,msg):<br>&nbsp; &nbsp; url="https://www.fast2sms.com/dev/bulk"<br>&nbsp; &nbsp; params={<br>&nbsp; &nbsp; &nbsp; &nbsp; "authorization":"ZctzPjmw1mzJXKcdpPXRJR3c",#paste your api here by going to devapi and login to generate an api<br>&nbsp; &nbsp; &nbsp; &nbsp; "sender_id":"SMSINI",<br>&nbsp; &nbsp; &nbsp; &nbsp; "message":msg,<br>&nbsp; &nbsp; &nbsp; &nbsp; "language":"english",<br>&nbsp; &nbsp; &nbsp; &nbsp; "route":"p",<br>&nbsp; &nbsp; &nbsp; &nbsp; "numbers":a<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; rs=requests.get(url,params=params)<br><br><br>def send():<br>&nbsp; &nbsp; a=num.get()<br>&nbsp; &nbsp; if(a==""):<br>&nbsp; &nbsp; &nbsp; &nbsp; tsmg.showerror("Error","Enter Your Mobile Number")<br>&nbsp; &nbsp; elif (len(a)&lt;10):<br>&nbsp; &nbsp; &nbsp; &nbsp; tsmg.showerror("Error","Invalid Mobile Number")<br>&nbsp; &nbsp; &nbsp; &nbsp; num.set("")<br>&nbsp; &nbsp; else:<br>&nbsp; &nbsp; &nbsp; &nbsp; b=tsmg.askyesno("Info",f"Your Number is {a}")<br>&nbsp; &nbsp; &nbsp; &nbsp; if(b==True):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sms_send(a,msg)<br>&nbsp; &nbsp; &nbsp; &nbsp; else:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num.set("")<br><br>def check():<br>&nbsp; &nbsp; c=otp.get()<br>&nbsp; &nbsp; if(c==""):<br>&nbsp; &nbsp; &nbsp; &nbsp; tsmg.showerror("Error","Enter OTP")<br>&nbsp; &nbsp; else:<br>&nbsp; &nbsp; &nbsp; &nbsp; if(str(rand)==c):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tsmg.showinfo("Info","Successful")<br>&nbsp; &nbsp; &nbsp; &nbsp; else:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tsmg.showerror("Error","Invalid OTP")<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num.set("")<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; otp.set("")<br><br><br>root.geometry("500x500")<br>root.title("OTP-Checker")<br><br>num=StringVar()<br>otp=StringVar()<br><br>f1=Frame(root)<br>Label(f1,text="Check Your OTP",font="SegoeUI 30 bold",fg="purple").pack(padx=5,pady=10)<br>f1.pack(fill=BOTH)<br><br>f2=Frame(root)<br>Label(f2,text="Enter Your Number",font="SegoeUI 20 bold",fg="teal").pack(padx=5,pady=5)<br>e1=Entry(f2,textvariable=num,font="SegoeUI 14 bold",fg="black",bg="white",relief=SUNKEN,borderwidth=4,justify="center").pack(ipady=5)<br>f2.pack(fill=BOTH,padx=5,pady=10)<br><br>f3=Frame(root)<br>Label(f3,text="Enter OTP",font="SegoeUI 20 bold",fg="teal").pack(padx=5,pady=5)<br>e2=Entry(f3,textvariable=otp,font="SegoeUI 14 bold",fg="black",bg="white",relief=SUNKEN,borderwidth=5,justify="center").pack(ipady=5)<br>f3.pack(fill=BOTH,padx=5,pady=10)<br><br>f4=Frame(root)<br>Button(f4,text="Send OTP",command=send,font="SegoeUI 10 bold",fg="purple").pack(padx=20,pady=10,side=LEFT)<br>Button(f4,text="Check OTP",command=check,font="SegoeUI 10 bold",fg="purple").pack(padx=40,pady=10,side=LEFT)<br>f4.pack()<br><br><br>root.mainloop()</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/0f1dc292df22d2245e516ebf59452d03/images.png" />
         <pubDate>2021-05-21 06:09:52 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546800053</guid>
      </item>
      <item>
         <title>Music Player</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546801480</link>
         <description><![CDATA[<div>import pygame<br>from pygame import mixer<br>from tkinter import *<br>import os<br>def playsong():<br>&nbsp; &nbsp; currentsong=playlist.get(ACTIVE)<br>&nbsp; &nbsp; print(currentsong)<br>&nbsp; &nbsp; mixer.music.load(currentsong)<br>&nbsp; &nbsp; songstatus.set("Playing")<br>&nbsp; &nbsp; mixer.music.play()<br>def pausesong():<br>&nbsp; &nbsp; songstatus.set("Paused")<br>&nbsp; &nbsp; mixer.music.pause()<br>def stopsong():<br>&nbsp; &nbsp; songstatus.set("Stopped")<br>&nbsp; &nbsp; mixer.music.stop()<br>def resumesong():<br>&nbsp; &nbsp; songstatus.set("Resuming")<br>&nbsp; &nbsp; mixer.music.unpause()&nbsp; &nbsp;&nbsp;<br>root=Tk()<br>root.title('Project Music player project')<br>mixer.init()<br>songstatus=StringVar()<br>songstatus.set("choosing")<br>#playlist---------------<br>playlist=Listbox(root,selectmode=SINGLE,bg="DodgerBlue2",fg="white",font=('arial',15),width=40)<br>playlist.grid(columnspan=5)<br>os.chdir(r'C:/Users/Swaralaya/Desktop/pattu')<br>songs=os.listdir()<br>for s in songs:<br>&nbsp; &nbsp; playlist.insert(END,s)<br>playbtn=Button(root,text="play",command=playsong)<br>playbtn.config(font=('arial',20),bg="DodgerBlue2",fg="white",padx=7,pady=7)<br>playbtn.grid(row=1,column=0)<br>pausebtn=Button(root,text="Pause",command=pausesong)<br>pausebtn.config(font=('arial',20),bg="DodgerBlue2",fg="white",padx=7,pady=7)<br>pausebtn.grid(row=1,column=1)<br>stopbtn=Button(root,text="Stop",command=stopsong)<br>stopbtn.config(font=('arial',20),bg="DodgerBlue2",fg="white",padx=7,pady=7)<br>stopbtn.grid(row=1,column=2)<br>Resumebtn=Button(root,text="Resume",command=resumesong)<br>Resumebtn.config(font=('arial',20),bg="DodgerBlue2",fg="white",padx=7,pady=7)<br>Resumebtn.grid(row=1,column=3)<br>mainloop()<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/8517b7e0cd11999db777b4c9cb6adf83/download__2_.png" />
         <pubDate>2021-05-21 06:10:40 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546801480</guid>
      </item>
      <item>
         <title>Star Wars Game</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546812274</link>
         <description><![CDATA[<div>#This is the First Part:<br><br>import turtle<br>import math<br>import random<br><br>window = turtle.Screen()<br>window.setup(width=600, height=600)<br>window.title("Star Wars Game ")<br>window.bgcolor("black")<br><br>window.tracer(0)<br><br>vertex = ((0,15),(-15,0),(-18,5),(-18,-5),(0,0),(18,-5),(18, 5),(15, 0))<br>window.register_shape("player", vertex)<br><br>asVertex = ((0, 10), (5, 7), (3,3), (10,0), (7, 4), (8, -6), (0, -10), (-5, -5), (-7, -7), (-10, 0), (-5, 4), (-1, 8))<br>window.register_shape("chattan", asVertex)<br><br>####################<br>#This is the Second Part:<br><br><br>class Ankur(turtle.Turtle):<br>&nbsp; &nbsp; def __init__(self):<br>&nbsp; &nbsp; &nbsp; &nbsp; turtle.Turtle.__init__(self)<br><br>&nbsp; &nbsp; &nbsp; &nbsp; self.speed(0)<br>&nbsp; &nbsp; &nbsp; &nbsp; self.penup()<br><br><br>def ankur1(t1, t2):<br>&nbsp; &nbsp; x1 = t1.xcor()<br>&nbsp; &nbsp; y1 = t1.ycor()<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; x2 = t2.xcor()<br>&nbsp; &nbsp; y2 = t2.ycor()<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; taauko = math.atan2(y1 - y2, x1 - x2)<br>&nbsp; &nbsp; taauko = taauko * 180.0 / 3.14159<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; return taauko<br><br><br>player = Ankur()<br>player.color("white")<br>player.shape("player")<br>player.score = 0<br><br>####################<br>#This is the Third Part<br><br>missiles = []<br>for _ in range(3):<br>&nbsp; &nbsp; missile = Ankur()<br>&nbsp; &nbsp; missile.color("red")<br>&nbsp; &nbsp; missile.shape("arrow")<br>&nbsp; &nbsp; missile.speed = 1<br>&nbsp; &nbsp; missile.state = "ready"<br>&nbsp; &nbsp; missile.hideturtle()<br>&nbsp; &nbsp; missiles.append(missile)<br><br>pen = Ankur()<br>pen.color("white")<br>pen.hideturtle()<br>pen.goto(0, 250)<br>pen.write("Score: 0", False, align = "center", font = ("Arial", 24, "normal"))<br><br>####################<br>#This is the Fourth Part<br><br><br>chattans = []<br><br>for _ in range(5):&nbsp; &nbsp;<br>&nbsp; &nbsp; chattan = Ankur()<br>&nbsp; &nbsp; chattan.color("brown")<br>&nbsp; &nbsp; chattan.shape("arrow")<br><br>&nbsp; &nbsp; chattan.speed&nbsp; = random.randint(2, 3)/50<br>&nbsp; &nbsp; chattan.goto(0, 0)<br>&nbsp; &nbsp; taauko = random.randint(0, 260)<br>&nbsp; &nbsp; distance = random.randint(300, 400)<br>&nbsp; &nbsp; chattan.setheading(taauko)<br>&nbsp; &nbsp; chattan.fd(distance)<br>&nbsp; &nbsp; chattan.setheading(ankur1(player, chattan))<br>&nbsp; &nbsp; chattans.append(chattan)<br><br>####################<br>#This is the Functions for Defence Part<br><br>def baanya():<br>&nbsp; &nbsp; player.lt(20)<br>&nbsp; &nbsp;&nbsp;<br>def daanya():<br>&nbsp; &nbsp; player.rt(20)<br>&nbsp; &nbsp;&nbsp;<br>def fire_missile():<br>&nbsp; &nbsp; for missile in missiles:<br>&nbsp; &nbsp; &nbsp; &nbsp; if missile.state == "ready":<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; missile.goto(0, 0)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; missile.showturtle()<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; missile.setheading(player.heading())<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; missile.state = "fire"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break<br><br><br>window.listen()<br>window.onkey(baanya, "Left")<br>window.onkey(daanya, "Right")<br>window.onkey(fire_missile, "space")<br><br>####################<br>#This is the Functioning the Code Part-1<br><br>sakkyo = False<br>while True:<br><br>&nbsp; &nbsp; window.update()<br>&nbsp; &nbsp; player.goto(0, 0)<br>&nbsp; &nbsp;&nbsp;<br><br>&nbsp; &nbsp; for missile in missiles:<br>&nbsp; &nbsp; &nbsp; &nbsp; if missile.state == "fire":<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; missile.fd(missile.speed)<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; if missile.xcor() &gt; 300 or missile.xcor() &lt; -300 or missile.ycor() &gt; 300 or missile.ycor() &lt; -300:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; missile.hideturtle()<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; missile.state = "ready"<br><br>&nbsp; &nbsp; for chattan in chattans:&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; chattan.fd(chattan.speed)<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; for missile in missiles:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if chattan.distance(missile) &lt; 20:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; taauko = random.randint(0, 260)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; distance = random.randint(600, 800)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chattan.setheading(taauko)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chattan.fd(distance)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chattan.setheading(ankur1(player, chattan))<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chattan.speed += 0.01<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; missile.goto(600, 600)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; missile.hideturtle()<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; missile.state = "ready"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player.score += 10<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pen.clear()<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pen.write("Score: {}".format(player.score), False, align = "center", font = ("Arial", 24, "normal"))<br><br>&nbsp; &nbsp; &nbsp; &nbsp; ####################<br>&nbsp; &nbsp; &nbsp; &nbsp; #This is the Functioning the Code Part-2<br><br>&nbsp; &nbsp; &nbsp; &nbsp; if chattan.distance(player) &lt; 20:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; taauko = random.randint(0, 260)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; distance = random.randint(600, 800)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chattan.setheading(taauko)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chattan.fd(distance)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chattan.setheading(ankur1(player, chattan))<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chattan.speed += 0.005<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sakkyo = True<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player.score -= 30<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pen.clear()<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pen.write("Score: {}".format(player.score), False, align = "center", font = ("Arial", 24, "normal"))<br>&nbsp; &nbsp; if sakkyo == True:<br>&nbsp; &nbsp; &nbsp; &nbsp; player.hideturtle()<br>&nbsp; &nbsp; &nbsp; &nbsp; missile.hideturtle()<br>&nbsp; &nbsp; &nbsp; &nbsp; for a in chattans:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; a.hideturtle()<br>&nbsp; &nbsp; &nbsp; &nbsp; pen.clear()<br>&nbsp; &nbsp; &nbsp; &nbsp; break<br><br>window.mainloop()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/00c183df2c1e5537372997bebc2c5ddd/download__3_.png" />
         <pubDate>2021-05-21 06:16:35 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546812274</guid>
      </item>
      <item>
         <title>Break the Wall</title>
         <author>pynix1621</author>
         <link>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546816440</link>
         <description><![CDATA[<div>"""&nbsp;<br>&nbsp;Sample Breakout Game<br>&nbsp;<br>&nbsp;Sample Python/Pygame Programs<br>&nbsp;Simpson College Computer Science<br>&nbsp;http://programarcadegames.com/<br>&nbsp;http://simpson.edu/computer-science/<br>"""&nbsp;<br><br># --- Import libraries used for this program<br><br>import math<br>import pygame<br><br># Define some colors<br>black = (0, 0, 0)<br>white = (255, 255, 255)<br>blue = (0, 0, 255)<br><br># Size of break-out blocks<br>block_width = 23<br>block_height = 15<br><br>class Block(pygame.sprite.Sprite):<br>&nbsp; &nbsp; """This class represents each block that will get knocked out by the ball<br>&nbsp; &nbsp; It derives from the "Sprite" class in Pygame """<br><br>&nbsp; &nbsp; def __init__(self, color, x, y):<br>&nbsp; &nbsp; &nbsp; &nbsp; """ Constructor. Pass in the color of the block,&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and its x and y position. """<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Call the parent class (Sprite) constructor<br>&nbsp; &nbsp; &nbsp; &nbsp; super().__init__()<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Create the image of the block of appropriate size<br>&nbsp; &nbsp; &nbsp; &nbsp; # The width and height are sent as a list for the first parameter.<br>&nbsp; &nbsp; &nbsp; &nbsp; self.image = pygame.Surface([block_width, block_height])<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Fill the image with the appropriate color<br>&nbsp; &nbsp; &nbsp; &nbsp; self.image.fill(color)<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Fetch the rectangle object that has the dimensions of the image<br>&nbsp; &nbsp; &nbsp; &nbsp; self.rect = self.image.get_rect()<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Move the top left of the rectangle to x,y.<br>&nbsp; &nbsp; &nbsp; &nbsp; # This is where our block will appear..<br>&nbsp; &nbsp; &nbsp; &nbsp; self.rect.x = x<br>&nbsp; &nbsp; &nbsp; &nbsp; self.rect.y = y<br><br><br>class Ball(pygame.sprite.Sprite):<br>&nbsp; &nbsp; """ This class represents the ball&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; It derives from the "Sprite" class in Pygame """<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # Speed in pixels per cycle<br>&nbsp; &nbsp; speed = 10.0<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # Floating point representation of where the ball is<br>&nbsp; &nbsp; x = 0.0<br>&nbsp; &nbsp; y = 180.0<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # Direction of ball (in degrees)<br>&nbsp; &nbsp; direction = 200<br><br>&nbsp; &nbsp; width = 10<br>&nbsp; &nbsp; height = 10<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # Constructor. Pass in the color of the block, and its x and y position<br>&nbsp; &nbsp; def __init__(self):<br>&nbsp; &nbsp; &nbsp; &nbsp; # Call the parent class (Sprite) constructor<br>&nbsp; &nbsp; &nbsp; &nbsp; super().__init__()<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Create the image of the ball<br>&nbsp; &nbsp; &nbsp; &nbsp; self.image = pygame.Surface([self.width, self.height])<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Color the ball<br>&nbsp; &nbsp; &nbsp; &nbsp; self.image.fill(white)<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Get a rectangle object that shows where our image is<br>&nbsp; &nbsp; &nbsp; &nbsp; self.rect = self.image.get_rect()<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Get attributes for the height/width of the screen<br>&nbsp; &nbsp; &nbsp; &nbsp; self.screenheight = pygame.display.get_surface().get_height()<br>&nbsp; &nbsp; &nbsp; &nbsp; self.screenwidth = pygame.display.get_surface().get_width()<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; def bounce(self, diff):<br>&nbsp; &nbsp; &nbsp; &nbsp; """ This function will bounce the ball&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; off a horizontal surface (not a vertical one) """<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; self.direction = (180 - self.direction) % 360<br>&nbsp; &nbsp; &nbsp; &nbsp; self.direction -= diff<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; def update(self):<br>&nbsp; &nbsp; &nbsp; &nbsp; """ Update the position of the ball. """<br>&nbsp; &nbsp; &nbsp; &nbsp; # Sine and Cosine work in degrees, so we have to convert them<br>&nbsp; &nbsp; &nbsp; &nbsp; direction_radians = math.radians(self.direction)<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Change the position (x and y) according to the speed and direction<br>&nbsp; &nbsp; &nbsp; &nbsp; self.x += self.speed * math.sin(direction_radians)<br>&nbsp; &nbsp; &nbsp; &nbsp; self.y -= self.speed * math.cos(direction_radians)<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Move the image to where our x and y are<br>&nbsp; &nbsp; &nbsp; &nbsp; self.rect.x = self.x<br>&nbsp; &nbsp; &nbsp; &nbsp; self.rect.y = self.y<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Do we bounce off the top of the screen?<br>&nbsp; &nbsp; &nbsp; &nbsp; if self.y &lt;= 0:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.bounce(0)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.y = 1<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Do we bounce off the left of the screen?<br>&nbsp; &nbsp; &nbsp; &nbsp; if self.x &lt;= 0:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.direction = (360 - self.direction) % 360<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.x = 1<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Do we bounce of the right side of the screen?<br>&nbsp; &nbsp; &nbsp; &nbsp; if self.x &gt; self.screenwidth - self.width:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.direction = (360 - self.direction) % 360<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.x = self.screenwidth - self.width - 1<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Did we fall off the bottom edge of the screen?<br>&nbsp; &nbsp; &nbsp; &nbsp; if self.y &gt; 600:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return True<br>&nbsp; &nbsp; &nbsp; &nbsp; else:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return False<br><br>class Player(pygame.sprite.Sprite):<br>&nbsp; &nbsp; """ This class represents the bar at the bottom that the player controls. """<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; def __init__(self):<br>&nbsp; &nbsp; &nbsp; &nbsp; """ Constructor for Player. """<br>&nbsp; &nbsp; &nbsp; &nbsp; # Call the parent's constructor<br>&nbsp; &nbsp; &nbsp; &nbsp; super().__init__()<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; self.width = 75<br>&nbsp; &nbsp; &nbsp; &nbsp; self.height = 15<br>&nbsp; &nbsp; &nbsp; &nbsp; self.image = pygame.Surface([self.width, self.height])<br>&nbsp; &nbsp; &nbsp; &nbsp; self.image.fill((white))<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Make our top-left corner the passed-in location.<br>&nbsp; &nbsp; &nbsp; &nbsp; self.rect = self.image.get_rect()<br>&nbsp; &nbsp; &nbsp; &nbsp; self.screenheight = pygame.display.get_surface().get_height()<br>&nbsp; &nbsp; &nbsp; &nbsp; self.screenwidth = pygame.display.get_surface().get_width()<br><br>&nbsp; &nbsp; &nbsp; &nbsp; self.rect.x = 0<br>&nbsp; &nbsp; &nbsp; &nbsp; self.rect.y = self.screenheight-self.height<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; def update(self):<br>&nbsp; &nbsp; &nbsp; &nbsp; """ Update the player position. """<br>&nbsp; &nbsp; &nbsp; &nbsp; # Get where the mouse is<br>&nbsp; &nbsp; &nbsp; &nbsp; pos = pygame.mouse.get_pos()<br>&nbsp; &nbsp; &nbsp; &nbsp; # Set the left side of the player bar to the mouse position<br>&nbsp; &nbsp; &nbsp; &nbsp; self.rect.x = pos[0]<br>&nbsp; &nbsp; &nbsp; &nbsp; # Make sure we don't push the player paddle&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # off the right side of the screen<br>&nbsp; &nbsp; &nbsp; &nbsp; if self.rect.x &gt; self.screenwidth - self.width:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.rect.x = self.screenwidth - self.width<br><br># Call this function so the Pygame library can initialize itself<br>pygame.init()<br><br># Create an 800x600 sized screen<br>screen = pygame.display.set_mode([800, 600])<br><br># Set the title of the window<br>pygame.display.set_caption('Breakout')<br><br># Enable this to make the mouse disappear when over our window<br>pygame.mouse.set_visible(0)<br><br># This is a font we use to draw text on the screen (size 36)<br>font = pygame.font.Font(None, 36)<br><br># Create a surface we can draw on<br>background = pygame.Surface(screen.get_size())<br><br># Create sprite lists<br>blocks = pygame.sprite.Group()<br>balls = pygame.sprite.Group()<br>allsprites = pygame.sprite.Group()<br><br># Create the player paddle object<br>player = Player()<br>allsprites.add(player)<br><br># Create the ball<br>ball = Ball()<br>allsprites.add(ball)<br>balls.add(ball)<br><br># The top of the block (y position)<br>top = 80<br><br># Number of blocks to create<br>blockcount = 32<br><br># --- Create blocks<br><br># Five rows of blocks<br>for row in range(5):<br>&nbsp; &nbsp; # 32 columns of blocks<br>&nbsp; &nbsp; for column in range(0, blockcount):<br>&nbsp; &nbsp; &nbsp; &nbsp; # Create a block (color,x,y)<br>&nbsp; &nbsp; &nbsp; &nbsp; block = Block(blue, column * (block_width + 2) + 1, top)<br>&nbsp; &nbsp; &nbsp; &nbsp; blocks.add(block)<br>&nbsp; &nbsp; &nbsp; &nbsp; allsprites.add(block)<br>&nbsp; &nbsp; # Move the top of the next row down<br>&nbsp; &nbsp; top += block_height + 2<br><br># Clock to limit speed<br>clock = pygame.time.Clock()<br><br># Is the game over?<br>game_over = False<br><br># Exit the program?<br>exit_program = False<br><br># Main program loop<br>while exit_program != True:<br><br>&nbsp; &nbsp; # Limit to 30 fps<br>&nbsp; &nbsp; clock.tick(30)<br><br>&nbsp; &nbsp; # Clear the screen<br>&nbsp; &nbsp; screen.fill(black)<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # Process the events in the game<br>&nbsp; &nbsp; for event in pygame.event.get():<br>&nbsp; &nbsp; &nbsp; &nbsp; if event.type == pygame.QUIT:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit_program = True<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # Update the ball and player position as long<br>&nbsp; &nbsp; # as the game is not over.<br>&nbsp; &nbsp; if not game_over:<br>&nbsp; &nbsp; &nbsp; &nbsp; # Update the player and ball positions<br>&nbsp; &nbsp; &nbsp; &nbsp; player.update()<br>&nbsp; &nbsp; &nbsp; &nbsp; game_over = ball.update()<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # If we are done, print game over<br>&nbsp; &nbsp; if game_over:<br>&nbsp; &nbsp; &nbsp; &nbsp; text = font.render("Game Over", True, white)<br>&nbsp; &nbsp; &nbsp; &nbsp; textpos = text.get_rect(centerx=background.get_width()/2)<br>&nbsp; &nbsp; &nbsp; &nbsp; textpos.top = 300<br>&nbsp; &nbsp; &nbsp; &nbsp; screen.blit(text, textpos)<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # See if the ball hits the player paddle<br>&nbsp; &nbsp; if pygame.sprite.spritecollide(player, balls, False):<br>&nbsp; &nbsp; &nbsp; &nbsp; # The 'diff' lets you try to bounce the ball left or right&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # depending where on the paddle you hit it<br>&nbsp; &nbsp; &nbsp; &nbsp; diff = (player.rect.x + player.width/2) - (ball.rect.x+ball.width/2)<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Set the ball's y position in case&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # we hit the ball on the edge of the paddle<br>&nbsp; &nbsp; &nbsp; &nbsp; ball.rect.y = screen.get_height() - player.rect.height - ball.rect.height - 1<br>&nbsp; &nbsp; &nbsp; &nbsp; ball.bounce(diff)<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # Check for collisions between the ball and the blocks<br>&nbsp; &nbsp; deadblocks = pygame.sprite.spritecollide(ball, blocks, True)<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # If we actually hit a block, bounce the ball<br>&nbsp; &nbsp; if len(deadblocks) &gt; 0:<br>&nbsp; &nbsp; &nbsp; &nbsp; ball.bounce(0)<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # Game ends if all the blocks are gone<br>&nbsp; &nbsp; &nbsp; &nbsp; if len(blocks) == 0:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; game_over = True<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # Draw Everything<br>&nbsp; &nbsp; allsprites.draw(screen)<br><br>&nbsp; &nbsp; # Flip the screen and show what we've drawn<br>&nbsp; &nbsp; pygame.display.flip()<br><br>pygame.quit()<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/857974786/c2c6ba5389d6056f5a3da2834a6069b6/Screenshot_2021_05_21_114959.jpg" />
         <pubDate>2021-05-21 06:18:54 UTC</pubDate>
         <guid>https://padlet.com/pynix1621/kynglo8ezy8fsxff/wish/1546816440</guid>
      </item>
   </channel>
</rss>
