ma modeste contributionTipoucet a écrit :Qui essaie en OPL pour PSION5 ?
J'aimerais bien mais déjà pas très doué en basic, alors en OPL faudrait pas être pressé
ça serait pourtant intéressant car j'avais testé le P5 4 fois plus rapide que le PC-E500
en OPL non optimisé sur psion revo
rapide -> une generation toutes les 7 a 8 secondes
sur CASIO CG10 en basic casio , c'est une plus d'une minute par generation
PROC m:
global a(1050)
global b(1050)
global d(10)
global x,y,q,dcx,gen
global k,k1,p,pop
global i,i1,j,m,t
m=5
t=30
dcx=172
d(1)=-(t+1):d(2)=-(t):d(3)=-(t-1)
d(4)=-1:d(5)=1
d(6)=t-1
d(7)=t :d(8)=t+1
d(9)=0
gen=0
init:
q=0
while q<>27
aff:
calcul:
recopie:
q=key
endwh
rem fin
k=alert ("fini")
:
ENDP
proc pointa:
gat (i-1)*m,(j-1)*m
gfill m-1,m-1,0
endp
proc pointb:
gat dcx+(i-1)*m,(j-1)*m
gfill m-1,m-1,0
endp
proc init:
gstyle 9
gat 348,22
gprint"Microbes"
gstyle 0
gat 348,60:gprint"Initialisation"
i=2
while i<=t+1
j=2
while j<=t+1
p=i*t+j
k=rnd
a(p)=0
if k>0.5
a(p)=1
endif
j=j+1
endwh
i=i+1
endwh
endp
proc aff:
cls
gcls
pop=0
gstyle 9
gat 348,22
gprint"Microbes"
i=2
while i<=t+1
j=2
while j<=t+1
p=i*t+j
if a(p)<>0
pop=pop+1
pointa:
endif
j=j+1
endwh
i=i+1
endwh
gstyle 0
gat 348,40:gprint "Population:";pop
gen=gen+1
gat 348,60:gprint "Generation ";gen
endp
proc recopie:
gat 348,64:gfill 100,20,1
gat 348,80:gprint "Recopie "
i=2
while i<=t+1
j=2
while j<=t+1
p=i*t+j
a(p)=b(p)
j=j+1
endwh
i=i+1
endwh
endp
proc calcul:
gat 348,80:gprint"Calcul ..."
i=2
while i<=t+1
j=2
while j<=t+1
p=i*t+j
k=0
i1=1
k1=a(p)
while i1<=8
k=k+a(p+d(i1))
i1=i1+1
endwh
b(p)=0
if k=3
b(p)=1
pointb:
endif
if k1=1 and (k=2 or k=3)
pointb:
b(p)=1
endif
j=j+1
endwh
i=i+1
endwh
endp