crénom, that's odd, I can open it without any problem...
but because I'm a very kind guy, I'll modify it to make it work with DBC
for DBC (not in twnty lines .. I'm not in a mood to fold it ^^)
set display mode 800,600,32
sync on
sync rate 0
sync
randomize timer()
set text size 18
dim pos(150,2)
ink rgb(50,50,50),0
box 100,100,700,500
ink rgb(255,255,255),0
print "Click on the box to place navpoints, then press RETURN"
repeat
if mouseclick()=1 and mousex()>100 and mousey()>100 and mousex()<700 and mousey()<500
repeat
until mouseclick()=0
ink rgb(255,255,255),0
inc nbr_points
pos(nbr_points,1) = mousex()
pos(nbr_points,2) = mousey()
circle mousex(),mousey(),5
endif
sync
until returnkey()=1
repeat:until returnkey()=0
input "Number of pets> ",nbr_org
if nbr_org = 0 then nbr_org = 5
dim adn(nbr_org,nbr_points)
dim dist(nbr_org)
for t=1 to nbr_org
undim pris(0)
dim pris(nbr_points)
for u=1 to nbr_points
repeat
var = rnd(nbr_points-1)+1
until pris(var)=0
pris(var)=1
adn(t,u)=var
next u
next t
do
inc gen
cls
for t=1 to nbr_org
dist(t)=0
for u=1 to nbr_points-1
dist(t) = dist(t) + sqrt((pos(adn(t,u),1) - pos(adn(t,u+1),1))^2 + (pos(adn(t,u),2) - pos(adn(t,u+1),2))^2 )
next u
dist(t)=dist(t)+sqrt((pos(adn(t,nbr_points),1) - pos(adn(t,1),1))^2 + (pos(adn(t,nbr_points),2) - pos(adn(t,1),2))^2 )
next t
record = 3 * (10^6)
nul = 0
for u=1 to nbr_org
if dist(u)<record
record = dist(u)
meilleur = u
endif
if dist(u)>nul
nul = dist(u)
mauvais = u
endif
next u
print "Best way> ",record," pixels"
print "Génération> ",gen
inepte = mauvais
repeat
choosen = rnd(nbr_org-1)+1
until choosen<>mauvais
for t=1 to nbr_points
adn(inepte,t)=adn(choosen,t)
next t
mutation_a = 1+rnd(nbr_points-1)
repeat
mutation_b = 1+rnd(nbr_points-1)
until mutation_b <> mutation_a
var = adn(inepte,mutation_b)
adn(inepte,mutation_b)=adn(choosen,mutation_a)
adn(inepte,mutation_a)=var
if rnd(10)=0
repeat
mutant = rnd(nbr_org-1)+1
until mutant<>meilleur
mutation_a = 1+rnd(nbr_points-1)
repeat
mutation_b = 1+rnd(nbr_points-1)
until mutation_b <> mutation_a
var = adn(mutant,mutation_b)
adn(mutant,mutation_b)=adn(mutant,mutation_a)
adn(mutant,mutation_a)=var
endif
ink rgb(255,255,255),0
for t=1 to nbr_points
circle pos(t,1),pos(t,2),5
next t
ink rgb(50,50,50),0
for o=1 to nbr_org
for t=1 to nbr_points-1
line pos(adn(o,t),1),pos(adn(o,t),2),pos(adn(o,t+1),1),pos(adn(o,t+1),2)
next t
line pos(adn(o,nbr_points),1),pos(adn(o,nbr_points),2),pos(adn(o,1),1),pos(adn(o,1),2)
next o
ink rgb(0,0,255),0
win = meilleur
for t=1 to nbr_points-1
line pos(adn(win,t),1),pos(adn(win,t),2),pos(adn(win,t+1),1),pos(adn(win,t+1),2)
next t
line pos(adn(win,nbr_points),1),pos(adn(win,nbr_points),2),pos(adn(win,1),1),pos(adn(win,1),2)
ink rgb(255,255,255),0
sync
loop
it's about ten time slower in DBC than in DBP, so don't put too many waypoints (10 and less are enough, but you can put more - if you've enough time ^^)
The sleeper must awaken !