from visual import * from random import * scene = display(title='5x5 Letters',width=800,height=800,center=(0.5,0.5,0),range=0.6) x=0.0 y=0.0 E=0 F=0 count=0 r=1.0/5.0 p=r*r ## Is better to use p = 1/(Number of Rules) here while count<10000: count=count+1 RN=random() ## Row 1 (F=0*r) : if (RN>0*p and RN<=1*p) : E=0 F=0 x=r*x+E y=r*y+F if (RN>1*p and RN<=2*p) : E=r F=0 x=r*x+E y=r*y+F if (RN>2*p and RN<=3*p) : E=2*r F=0 x=r*x+E y=r*y+F if (RN>3*p and RN<=4*p) : E=3*r F=0 x=r*x+E y=r*y+F if (RN>4*p and RN<=5*p) : E=4*r F=0 x=r*x+E y=r*y+F ## Row 2 (F=1*r) : if (RN>5*p and RN<=6*p) : E=0 F=r x=r*x+E y=r*y+F if (RN>6*p and RN<=7*p) : E=r F=r x=r*x+E y=r*y+F if (RN>7*p and RN<=8*p) : E=2*r F=r x=r*x+E y=r*y+F if (RN>8*p and RN<=9*p) : E=3*r F=r x=r*x+E y=r*y+F if (RN>9*p and RN<=10*p) : E=4*r F=r x=r*x+E y=r*y+F ## Row 3 (F=2*r): if (RN>10*p and RN<=11*p) : E=0 F=2*r x=r*x+E y=r*y+F if (RN>11*p and RN<=12*p) : E=r F=2*r x=r*x+E y=r*y+F if (RN>12*p and RN<=13*p) : E=2*r F=2*r x=r*x+E y=r*y+F if (RN>13*p and RN<=14*p) : E=3*r F=2*r x=r*x+E y=r*y+F if (RN>14*p and RN<=15*p) : E=4*r F=2*r x=r*x+E y=r*y+F ## Row 4 (F=3*r): if (RN>15*p and RN<=16*p) : E=0 F=3*r x=r*x+E y=r*y+F if (RN>16*p and RN<=17*p) : E=r F=3*r x=r*x+E y=r*y+F if (RN>17*p and RN<=18*p) : E=2*r F=3*r x=r*x+E y=r*y+F if (RN>18*p and RN<=19*p) : E=3*r F=3*r x=r*x+E y=r*y+F if (RN>19*p and RN<=20*p) : E=4*r F=3*r x=r*x+E y=r*y+F ## Row 5 (F=4*r): if (RN>20*p and RN<=21*p) : E=0 F=4*r x=r*x+E y=r*y+F if (RN>21*p and RN<=22*p) : E=r F=4*r x=r*x+E y=r*y+F if (RN>22*p and RN<=23*p) : E=2*r F=4*r x=r*x+E y=r*y+F if (RN>23*p and RN<=24*p) : E=3*r F=4*r x=r*x+E y=r*y+F if (RN>24*p and RN<=25*p) : E=4*r F=4*r x=r*x+E y=r*y+F dot=sphere(pos=(x,y), radius=0.002)