twitter.py

Created by schraf

Created on June 13, 2022

310 Bytes

Lancez ce script sur une vraie machine. La calculatrice attend un appui sur un chiffre impair (1,3,5,7 ou 9) puis sur 2 ou 8 et à nouveau un nombre impair, etc.

La formule (1 + (k + 3) % 9) * (k < 48) permet de transformer les codes des touches en chiffres : 42 -> 1, 44 -> 3 etc


from ion import keydown

def chiffres(*dg): 
 while True:
  for k in dg:
   if keydown(k):
    while keydown(k): continue
    return (1 + (k + 3) % 9) * (k < 48) 
    
    
while True:
  # on attend un chiffre impair
  print(chiffres(42,44,37,30,32))
  # puis 2 ou 8
  print(chiffres(43,31))

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 <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.