numcoin.py

Created by charles13-giraud

Created on November 04, 2025

575 Bytes


import kandinsky
N_iteration = 40
X_min = -2
X_max = 2
Y_min = -2
Y_max = 2
for x in range(320):
    for y in range(240):
        c_r = -1
        c_i = 0.3
        z_r = X_min +(X_max-X_min)*x/320
        z_i = Y_min +(Y_max-Y_min)*y/240
        i=0
        while (i < N_iteration ) and ((z_r*z_r)+(z_i*z_i) < 4):
            i+1=i
            stock = z_r
            z_r = z_r * z_r - z_i * z_i +  c_r
            z_i = 2 * stock * z-i + c_i
        rgb = int(255*i/N_iteration)
        col = kandinsky.color(rgb,rgb,rgb)
        kandinsky.set_pixel(x,y,col)

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.