נוספו מצגות מערכת השידורים נוסח מלא
מבוסס על פרויקט של תלמידי העתודה. עליכם לבחור את כובע הקסמים הרצוי. מתחת לכובע תימצאו (או שלא) כדור.
מיקום הכדור מוגרל באופן אקראי.
בחרתי לערוך את התמונות בפאואר פוינט, כלי שיש בכל בית ספר. להוריד את הרקע הלבן ועצב מעט את התמונות.
לבסוף יש לשמור אותן בסיומת gif בתקייה הרצויה. רצוי לשמור את קובץ התכנית באותה תיקייה עם התמונות.
import turtle
import random
import time
screen = turtle.Screen()
screen.setup(700,700)
screen.addshape("hat1.gif")
screen.addshape("hat2.gif")
screen.addshape("hat3.gif")
screen.addshape("win.gif")
screen.addshape("clear.gif")
screen.addshape("play.gif")
screen.addshape("X.gif")
t1=turtle.Turtle()
t2=turtle.Turtle()
t3=turtle.Turtle()
t4=turtle.Turtle()
t5=turtle.Turtle()
t6=turtle.Turtle()
t7=turtle.Turtle()
msg=turtle.Turtle()
msg.pu()
msg.goto(0,200)
msg.shape("circle")
msg.speed(0)
msg.pencolor("green")
msg.ht()
msg.write("Guess Game", align="center", font=("Comic Sans MS", 50, "normal"))
hats=[1,2,3]
ch=random.choice(hats)
t7.pu()
t7.goto(0,-200)
t7.shape("circle")
t7.speed(0)
t7.pencolor("green")
t7.ht()
t7.write(ch, align="center", font=("Comic Sans MS", 50, "normal"))
#guess
def clickme7(x,y):
t7.clear()
global ch
ch=random.choice(hats)
time.sleep(1
#play
def clickme6(x,y):
t1.shape("hat1.gif")
t2.shape("hat2.gif")
t3.shape("hat3.gif")
clickme7(0,0)
t1.pu()
t1.goto(-200,0)
t1.shape("hat1.gif")
t1.pensize(1)
t1.speed(0)
t2.pu()
t2.goto(0,0)
t2.shape("hat2.gif")
t2.pensize(1)
t2.speed(0)
t3.pu()
t3.goto(200,0)
t3.shape("hat3.gif")
t3.pensize(1)
t3.speed(0)
t5=turtle.Turtle()
t5.pu()
t5.goto(-200,-150)
t5.shape("clear.gif")
t5.pensize(1)
t5.speed(0)
t6=turtle.Turtle()
t6.pu()
t6.goto(200,-150)
t6.shape("play.gif")
t6.pensize(1)
t6.speed(0)
#hat 1
def clickme1(x,y):
t7.shape("blank")
if(ch==1):
t1.shape("win.gif")
t2.shape("blank")
t3.shape("blank")
time.sleep(1)
else:
t1.shape("X.gif")
t7.write(ch, align="center", font=("Comic Sans MS", 50, "normal"))
t2.shape("blank")
t3.shape("blank")
#hat 2
def clickme2(x,y):
t7.shape("blank")
if(ch==2):
t2.shape("win.gif")
t1.shape("blank")
t3.shape("blank")
time.sleep(1)
else:
t2.shape("X.gif")
t1.shape("blank")
t3.shape("blank")
t7.write(ch, align="center", font=("Comic Sans MS", 50, "normal"))
#hat 3
def clickme3(x,y):
t7.shape("blank")
if(ch==3):
t3.shape("win.gif")
t1.shape("blank")
t2.shape("blank")
time.sleep(1)
else:
t3.shape("X.gif")
t1.shape("blank")
t2.shape("blank")
t7.write(ch, align="center", font=("Comic Sans MS", 50, "normal"))
#clear
def clickme5(x,y):
t1.shape("blank")
t2.shape("blank")
t3.shape("blank")
t1.onclick(clickme1)
t2.onclick(clickme2)
t3.onclick(clickme3)
t5.onclick(clickme5)
t6.onclick(clickme6)
import turtle
import random
import time
screen = turtle.Screen()
screen.setup(700,700)
screen.addshape("hat1.gif")
screen.addshape("hat2.gif")
screen.addshape("hat3.gif")
screen.addshape("win.gif")
screen.addshape("clear.gif")
screen.addshape("play.gif")
screen.addshape("X.gif")
t1=turtle.Turtle()
t2=turtle.Turtle()
t3=turtle.Turtle()
t4=turtle.Turtle()
t5=turtle.Turtle()
t6=turtle.Turtle()
t7=turtle.Turtle()
msg=turtle.Turtle()
msg.pu()
msg.goto(0,200)
msg.shape("circle")
msg.speed(0)
msg.pencolor("green")
msg.ht()
msg.write("Guess Game", align="center", font=("Comic Sans MS", 50, "normal"))
hats=[1,2,3]
ch=random.choice(hats)
t7.pu()
t7.goto(0,-200)
t7.shape("circle")
t7.speed(0)
t7.pencolor("green")
t7.ht()
t7.write(ch, align="center", font=("Comic Sans MS", 50, "normal"))
#guess
def clickme7(x,y):
t7.clear()
global ch
ch=random.choice(hats)
time.sleep(1)
#play
def clickme6(x,y):
t1.shape("hat1.gif")
t2.shape("hat2.gif")
t3.shape("hat3.gif")
clickme7(0,0)
t1.pu()
t1.goto(-200,0)
t1.shape("hat1.gif")
t1.pensize(1)
t1.speed(0)
t2.pu()
t2.goto(0,0)
t2.shape("hat2.gif")
t2.pensize(1)
t2.speed(0)
t3.pu()
t3.goto(200,0)
t3.shape("hat3.gif")
t3.pensize(1)
t3.speed(0)
#hat 1
def clickme1(x,y):
t7.shape("blank")
if(ch==1):
t1.shape("win.gif")
t2.shape("blank")
t3.shape("blank")
time.sleep(1)
else:
t1.shape("X.gif")
t7.write(ch, align="center", font=("Comic Sans MS", 50, "normal"))
t2.shape("blank")
t3.shape("blank")
#hat 2
def clickme2(x,y):
t7.shape("blank")
if(ch==2):
t2.shape("win.gif")
t1.shape("blank")
t3.shape("blank")
time.sleep(1)
else:
t2.shape("X.gif")
t1.shape("blank")
t3.shape("blank")
t7.write(ch, align="center", font=("Comic Sans MS", 50, "normal"))
#hat 3
def clickme3(x,y):
t7.shape("blank")
if(ch==3):
t3.shape("win.gif")
t1.shape("blank")
t2.shape("blank")
time.sleep(1)
else:
t3.shape("X.gif")
t1.shape("blank")
t2.shape("blank")
t7.write(ch, align="center", font=("Comic Sans MS", 50, "normal"))
#clear
def clickme5(x,y):
t1.shape("blank")
t2.shape("blank")
t3.shape("blank")
t5=turtle.Turtle()
t5.pu()
t5.goto(-200,-150)
t5.shape("clear.gif")
t5.pensize(1)
t5.speed(0)
t6=turtle.Turtle()
t6.pu()
t6.goto(200,-150)
t6.shape("play.gif")
t6.pensize(1)
t6.speed(0)
t1.onclick(clickme1)
t2.onclick(clickme2)
t3.onclick(clickme3)
t5.onclick(clickme5)
t6.onclick(clickme6)