matrix.py

Created by schraf

Created on October 15, 2021

514 Bytes

Tenir la calculatrice en mode paysage


from random import *
from kandinsky import *

NR, VE = (0,0,0), (0,255,0)
lignes = [' ' * 32] * 32
tete = [0] * 32

def mat():
  while True:
   for n in range(32):
    if random()>.9:
      p = .8 if lignes[n][-1:] != " " else .1
      lignes[n] += chr(randint(32, 47)) if random() < p else " "
      lignes[n] = lignes[n][-32:]
      draw_string(lignes[n], 0, 7 * n, VE, NR)
      tete[n] = (tete[n] - 1) % 32
      draw_string(lignes[n % 16][tete[n]], 8 * tete[n], 7 * n, NR, (0,80,0))

mat()

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.