scratch.py

Created by huriel-mercier

Created on November 10, 2024

793 Bytes

Il est inspiré des blocks de scratch pour permettre aux utilisateurs d’avancer d’abord la turtle un peu comme une souris mais qui sert a dessiner et puis avec de l’imagination je voulais qu’il puissent remplacer les modules restreint de Numworks.


from math import *
from turtle import *
from time import *
from ion import *
from kandinsky import *
position=[10, 10]
text=""
speed(20)
penup()
goto(-150,-115),write("shift")
goto(-150,-95),write("write")
goto(-90,-115),write("alpha")
goto(-90,-95),write("circle")
goto(0,0)
speed(1)
pendown()

def afficher():
  print(chr(27)+"[2J")
  print("Texte:",text)
  print("Position:",position)

while True:#Boucle principal!
  if keydown(KEY_RIGHT):
    forward(20)
  elif keydown(KEY_LEFT):
    backward(20)
  elif keydown(KEY_UP):
    left(90)
    forward(20)
    right(90)
  elif keydown(KEY_DOWN):
    right(90)
    forward(20)
    left(90)
  elif keydown(KEY_SHIFT):
    lettre=input("Entrez une lettre:")
    text+=lettre
    afficher()
  elif keydown(KEY_ALPHA):
    circle(20)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.