調子に乗って飛ばしています。
お師匠のサンプルを拝借して、
#shida4.py
#last update 2020/8/29
#simply ported from
#SHIDACG.g3m
#by Krtyski/e-Gadget
from casioplot import *
from random import *
XMAX = 383
YMAX = 192
### Times input
def enter_times():
while True:
inp=input('Enter points #:')
if inp.isdigit():
times=int(inp)
break
else:
continue
return times
### Shida main
def shida(j=30000):
u=0;v=0;
w=320;h=240;
a=-2.3;b=5.8;c=0;d=8
k=w/(b-a)
l=h/(d-c)
for i in range(j):
r=random()
if r<0.01: #0.01
t=0
v=.16*v
col=(0,0,0) #black
elif r<0.07: #0.07
t=.20*u-.26*v
v=.23*u+.22*v+1.6
col=(255,0,0) #red
elif r<0.15: #0.15
t=(-0.15)*u+0.28*v
v=.26*u+.24*v+.44
col=(0,255,0) #green
else:
t=.85*u+.04*v
v=-.04*u+.85*v+1.6
col=(0,0,255) #blue
# Plot t,v,col for fx-CG50
u=t
g=int((u-a)*k)
h=int((v-c)*l)
if 1>g:g=1
if g>YMAX:g=YMAX #187
if 1>h:h=1
if h>XMAX:h=XMAX #379
set_pixel(h,g,col)
show_screen()
def main():
j = enter_times()
clear_screen()
shida(j)
draw_string(XMAX-12*18,10," fractal shida leaves",(0,0,0),"medium")
return "Done"
print(main())
"""
#Fontsize = 1 point/pixel
X Y
small 8 12
medium 12 16
large 16 24
"""
な感じにしてみました。
【参考記事】