# Commande principale: demarrer 7
pour new # set defaults, screen, pen et tortue init ftd [400 400] fcfg noir fcc vert levecrayon cachetortue fin pour initialise :order donne "total puissance :order 2 donne "cellsize 360/:order donne "offset (0.5*:order)-0.5 donne "side 250/:order fin pour demarrer :order new initialise :order fcc vert repete :total [ fpos gridpos :order compteur-1 square attends 20] fin pour gridpos :order :cellnum donne "x :cellsize*((reste :cellnum :order)-:offset) donne "y :cellsize*((quotient :cellnum :order)-:offset) retourne liste :x :y fin pour square #square drawn from centre recule :side/2 tournedroite 90 recule :side/2 baissecrayon repete 4 [avance :side tournegauche 90] levecrayon fin |
pour Art :Order New Initialise :Order Repete :Total [FPos GridPos :Order hasard :Total Square] fin pour Art :Order New Initialise :Order Repete :Total [FPos GridPos :Order compteur-1 bc Square td 90/(:Total-1) ] fin pour Art :Order New Initialise :Order donne "CellList [] Repete :Total [donne "RanSq hasard :Total si Non Membre? :RanSq :CellList [fPos GridPos :Order :RanSq Square donne "CellList mp :RanSq :CellList]] fcc rougefonce donne "Count :Order+1 Repete :Order-2 [ Repete :Order-2 [ si (Membre? :Count :CellList) & (Membre? :Count+1 :CellList) & (Membre? :Count-1 :CellList) & (Membre? :Count+:Order :CellList) & (Membre? :Count-:Order :CellList) [fPos GridPos :Order :Count bc remplis lc] donne "Count :Count+1] donne "Count :Count+2] fin |