#lang racket/gui

(require "Matrices.rkt")
(require "Reglas-vecindad.rkt")
(require "Hormiga.rkt")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define elemento%
  (class color%
    (init-field
     (estado 0)
     (dureza 0)
     (olor 'objeto_tipo_olor)
     )
    (define/public set-olor
      (lambda (obj)
        (set! olor obj)
        ))
    (define/public get-olor
      (lambda ()
        olor
        ))
    (define/public get-rgb
      (lambda ()
        (let ((r (send this red))
              (g (send this green))
              (b (send this blue))
              (o (send this alpha))
              )
          (list r g b o)
          )
        ))
    (define/public get-color
      (lambda ()
        this ))
    (define/public get-estado
      (lambda ()
        estado ))
    (define/public get-dureza
      (lambda ()
        dureza ))
    (super-new)
    ))
;;Objetos del tipo OLOR
(define olor%
  (class object%
    (init-field
     (tipo 0)
     (intensidad 0)
     )
    (define/public get-tipo
      (lambda ()
        tipo ))
    (define/public get-intensidad
      (lambda ()
        intensidad ))
    (define/public update-intensidad
      (lambda (valor)
        (set! intensidad
              (+ intensidad valor))
        ))
    (super-new)
    ))
;;;;;;;;;;;;
(define olor0;inodora
  (make-object olor% 0 0))
(define olor1;feromonas
  (make-object olor% 1 30))
(define olor2;comida verde
  (make-object olor% 2 10))
(define olor3;comida amarillo
  (make-object olor% 3 10))
(define olor4;el olor de una hormiga
  (make-object olor% 4 1))
(define olor5;el olor de otro autómata
  (make-object olor% 5 1))
(define olor6;el olor de azul y marrón
  (make-object olor% 6 1))
;;Estado dureza olor R   G   B   O
(define blanco
  (make-object elemento% 0 0 olor0 255 255 255 1.0))


(define rojo
  (make-object elemento% 1 5 olor5 255 0 0 1.0))
(define verde
  (make-object elemento% 2 2 olor2 0 255 0 1.0))

(define negro
  (make-object elemento% 3 6 olor4 0 0 0 1.0))
(define amarillo
  (make-object elemento% 4 3 olor3 255 215 0 1.0))

(define azul
  (make-object elemento% 5 7 olor6 0 0 255 1.0))
(define marron
  (make-object elemento% 6 8 olor6 132 60 36 1.0))


;;;;;;;;;;;;;;
(define entorno%
  (class object%
    (init-field
     (ff 0)
     (cc 0)
     (lista-hormigas '())
     )
    (define set-matriz
      (lambda (matriz obj)
        (let rows ((i 0)
                   (j ff))
          (if (= i j)
              matriz
              (let columnas ((m 0)
                             (n cc))
                (if (= m n)
                    (rows (add1 i) j)
                    (begin
                      (matriz-set! matriz i m obj)
                      (columnas (add1 m) n))
                    )
                )
              )
          )
        ))
    (define/public set-configuracion
      (lambda ()
        (set! configuracion (es-configuracion))
        ))
    (define es-configuracion
      (lambda ()
        (map
         (lambda (fila-obj fila-olor)
           (map
            (lambda (obj olor)
              (cons obj olor)
              )
            (vector->list fila-obj)
            (vector->list fila-olor))
           )
         (vector->list matriz-objetos)
         (vector->list tabla-olores)
         )
        ))
    (define/public set-locus!
      (lambda (f c obj)
        (let* ((olor_obj (send obj get-olor))
               (tipo_olor (send olor_obj get-tipo))
               )
          (matriz-set! matriz-objetos f c obj)
          (when (= tipo_olor 1)
            (matriz-set! tabla-olores f c olor_obj)
            )
          #t
          )
        ))
    (define/public get-locus;;;??
      (lambda (x y)
        (values
         (matriz-ref matriz-objetos x y vector-ref)
         (matriz-ref tabla-olores x y vector-ref)
         )
        ))
    (field
     (iteracion 0)
     (Lista-Hormigas lista-hormigas)
     (tabla-olores
      (set-matriz
       (make-matriz ff cc) (make-object olor% 0 0)))
     (matriz-objetos
      (set-matriz
       (make-matriz ff cc)
       (make-object elemento% 0 0 (make-object olor% 0 0) 255 255 255 1.0)))
     (configuracion (es-configuracion))
     )
    (define/public get-Lista-Hormigas;;;;;;;;;;;;;;;;;;;;;;
      (lambda ()
        Lista-Hormigas))
    (define/public get-matriz
      (lambda ()
         matriz-objetos ))
    (define/public get-dimensiones
      (lambda ()
        (cons ff cc) ))
    (define/public get-obj
      (lambda (x y)
        (matriz-ref matriz-objetos x y vector-ref)
        ))
    (define/public get-configuracion
      (lambda ()
        (es-configuracion) ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;    
    (define ley-basica
      (lambda (vec anim clave)
        (let* ((vec_obj (matriz-ref matriz-objetos (car vec) (cdr vec) vector-ref))
               (rgb_vec (send vec_obj get-rgb))
               )
          (cond
            ((eq? clave 'avanzar+feromona) (equal? rgb_vec (send blanco get-rgb)))
            ((eq? clave 'avanzar) (equal? rgb_vec (send blanco get-rgb)))
            ((eq? clave 'recoger-comida) (equal? rgb_vec (send amarillo get-rgb)))
            (else #f)
            )
          )
        ))
    (define multiplo-de
      (lambda (m n)
        (if (= (remainder m n) 0)
            #t
            #f)
        ))
    (define deposita-comida
      (lambda (f c1 c2);46 28 39 / 47 28 39
        (if (> c1 c2)
            #f
            (let* ((obj (matriz-ref matriz-objetos f c1 vector-ref))
                   (tipo_obj (send obj get-rgb))
                   )
              (if (equal? tipo_obj (list 255 255 255 1.0))
                  (matriz-set! matriz-objetos f c1 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
                  (deposita-comida f (add1 c1) c2)
                  )
              )
            )
        )
      )
    (define vecinos->objetos
      (lambda (vecinos data proc)
        (if (null? vecinos)
            '()
            (cons
             (matriz-ref data (car (first vecinos)) (cdr (first vecinos)) proc)
             (vecinos->objetos (rest vecinos) data proc)
             )
            )
        ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (define set-ramal!
      (lambda (lugares)
        (for-each
         (lambda (lugar)
           (let ((objeto (matriz-ref matriz-objetos (first lugar) (second lugar) vector-ref)))
             (if (is-a? objeto elemento%)
                 (send objeto set-olor (make-object olor% 1 30))
                 #t)
;           (send (matriz-ref matriz-objetos (first lugar) (second lugar) vector-ref) set-olor (make-object olor% 1 30))
             )
           (matriz-set! tabla-olores (first lugar) (second lugar) (make-object olor% 1 30))
           )
         lugares)
        ))
    (define protect
      (lambda (lista)
        (for-each
         (lambda (sitio)
           (matriz-set! matriz-objetos (car sitio) (cdr sitio) (make-object elemento% 0 0 (make-object olor% 0 0) 255 255 255 1.0))
           (matriz-set! tabla-olores (car sitio) (cdr sitio) (make-object olor% 0 0))
           )
         lista)
        ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (define/public procesar!
      (lambda (iter)
        (when (and (multiplo-de iter 6) (not (null? lista-hormigas)))
          (send M set-locus! 45 33 (car lista-hormigas))
          (set! lista-hormigas (cdr lista-hormigas))
          )
        (when (equal? (send (get-obj 45 33) get-rgb) (send blanco get-rgb))
          (set-locus! 45 33 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
          )
        (when (and (null? Lista-Hormigas) (odd? iter) (not (null? Hormigas)))
          (let-values ([(bloque1 bloque2) (split-at Hormigas 4)])
            (set! lista-hormigas bloque1)
            (set! Hormigas bloque2)
            (set! Lista-Hormigas lista-hormigas)
            )
          )
        (set! configuracion (es-configuracion))
        (let rows
          ((i 0)
           (j ff)
           )
          (if (= i j)
              (begin
                (when (< (length Hormigas) 12)
                  (set-ramal! ramal-derecho-lugares)
                  )
                ;(protect (list (cons 2 36) (cons 3 36) (cons 4 36)))
                (set! configuracion (es-configuracion))
                )
              (let columns
                ((m 0)
                 (n cc)
                 )
                (if (= m n)
                    (rows (add1 i) j)
                    (let* ((Obj (car (matriz-ref configuracion i m list-ref)))
                           )
                      (cond
                        ((is-a? Obj hormiga%)
                         (printf "~a:: ~n" (send Obj get-id))
                         (let*-values
                             ([(v1 v2 v3 v4 v5 v6 v7 v8) (Moore i m (sub1 ff) (sub1 cc))]
                              [(vecinos-obj) 
                               (vecinos->objetos (list v1 v2 v3 v4 v5 v6 v7 v8) matriz-objetos vector-ref)]
                              [(vecinos-olores)
                               (vecinos->objetos (list v1 v2 v3 v4 v5 v6 v7 v8) tabla-olores vector-ref)]
                              [(vecinos-coord) (list v1 v2 v3 v4 v5 v6 v7 v8)]
                              [(accion vecino automata)
                               (send Obj procesar! i m vecinos-coord vecinos-obj vecinos-olores)]
                              )
                           (cond
                             ((eq? accion 'stop)
                              (let*
                                    ((olor (matriz-ref tabla-olores (car automata) (cdr automata) vector-ref))
                                     (tipo_olor (send olor get-tipo))
                                     )
                                (cond
                                  ((= tipo_olor 1)
                                   (send olor update-intensidad 30)
                                   (matriz-set! tabla-olores (car automata) (cdr automata) olor)
                                   (matriz-set! matriz-objetos (car automata) (cdr automata) (make-object elemento% 0 0 olor 255 255 255 1.0))
                                   )
                                  (else
                                   (matriz-set! tabla-olores (car automata) (cdr automata) (make-object olor% 1 30))
                                   (matriz-set! matriz-objetos (car automata) (cdr automata) (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
                                   )
                                  )
                                (deposita-comida 47 28 39)
                                (set! Lista-Hormigas (remove Obj Lista-Hormigas))
                                (printf "Hormiga entra en hormiguero y deposita comida~n")
                                )
                              )
                             ((eq? accion 'avanzar+feromona)
                              (when (ley-basica vecino automata accion)
                                (let*
                                    ((olor_vec (matriz-ref tabla-olores (car vecino) (cdr vecino) vector-ref))
                                     (tipo_olor (send olor_vec get-tipo))
                                     (obj_vec (matriz-ref matriz-objetos (car vecino) (cdr vecino) vector-ref))
                                     )
                                  ;;se ubican el autómata y el vecino:
                                  (matriz-set! matriz-objetos (car vecino) (cdr vecino) Obj)
                                  (matriz-set! matriz-objetos i m obj_vec)
                                  ;;se comprueba si vecino huele a feromona
                                  (cond
                                    ((= tipo_olor 1)
                                     (send olor_vec update-intensidad 30)
                                     (matriz-set! tabla-olores (car vecino) (cdr vecino) olor_vec)
                                     )
                                    (else (matriz-set! tabla-olores (car vecino) (cdr vecino) (make-object olor% 1 30)))
                                    )
                                  (printf "Deja feromona en ~a. Rastro con intensidad: ~a~n" (cons i m) (exact->inexact(send (matriz-ref tabla-olores i m vector-ref) get-intensidad)))
                                  )
                                )
                              )
                             ((eq? accion 'avanzar)
                              (when (ley-basica vecino automata accion);;;;;;
                                (let*
                                    ((obj_vec (matriz-ref matriz-objetos (car vecino) (cdr vecino) vector-ref))
                                     (tipo_olor (send (matriz-ref tabla-olores i m vector-ref) get-tipo))
                                     (intensidad_olor (exact->inexact (send (matriz-ref tabla-olores i m vector-ref) get-intensidad)))
                                     )
                                  ;;se ubican el autómata y el vecino:
                                  (matriz-set! matriz-objetos (car vecino) (cdr vecino) Obj)
                                  (matriz-set! matriz-objetos i m obj_vec)
                                  (printf "Entorno: Ubicados autómata en ~a y objeto en ~a Feromona: ~a~n" vecino (cons i m)  (if (= tipo_olor 1) intensidad_olor "no hay")) 
                                  )
                                )
                              )
                             ((eq? accion 'girar) )
                             ((eq? accion 'parar) )
                             ((eq? accion 'recoger-comida);;;;;
                              (when (ley-basica vecino automata accion)
                                (matriz-set! matriz-objetos (car vecino) (cdr vecino) (make-object elemento% 0 0 (make-object olor% 0 0) 255 255 255 1.0))
                                (matriz-set! tabla-olores i m (make-object olor% 1 30))
                                (send Obj set-comida (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
                                ) 
                              )
                             )
                           ) 
                         );;fin primera clausula
                        (else
                         (let* ((olor (matriz-ref tabla-olores i m vector-ref))
                                (tipo_olor (send olor get-tipo))
                                )
                           (when (= tipo_olor 1)
                             (send olor update-intensidad -1/30)
                             ;controlar la disminución de feromona
                             (if (< (send olor get-intensidad) 0)
                                 (matriz-set! tabla-olores i m (make-object olor% 0 0))
                                 #t)
                             )
                           )
                         )
                        );;fin cond
                      (columns (add1 m) n)
                      )
                    )
                )
              )
          )
        ))
    (super-new)
    ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define Hormigas (list H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20))
(define M (make-object entorno% 50 50 (list)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CIERRE DE LA COMIDA
(send M set-locus! 5 39 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 5 40 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 5 41 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 4 41 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 3 41 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 2 41 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 1 41 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 41 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 0 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 1 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 2 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 3 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 4 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 5 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 6 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 7 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 8 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 9 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 10 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 0 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 30 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 31 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 32 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 33 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 34 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 36 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 37 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 39 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 40 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 0 41 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;COMIDA
(send M set-locus! 1 32 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 2 32 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 3 32 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 1 33 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 2 33 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 3 33 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 1 34 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 2 34 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 1 35 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 1 36 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 1 37 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 2 37 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 1 38 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 2 38 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 3 38 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 1 40 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 2 40 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 3 40 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))

(send M set-locus! 5 32 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 6 32 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 7 32 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))

(send M set-locus! 7 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 6 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 5 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 4 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 3 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 2 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 1 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))

(send M set-locus! 4 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 4 32 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 4 33 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 4 38 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 4 40 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))

(send M set-locus! 1 39 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 2 39 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 3 39 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 4 39 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))

(send M set-locus! 1 31 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 2 31 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 3 31 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 4 31 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))

(send M set-locus! 5 31 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 6 31 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 7 31 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 8 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 8 31 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 8 32 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 9 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 9 31 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 9 32 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 10 30 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 10 31 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
(send M set-locus! 10 32 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
;(send M set-locus! 2 36 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
;(send M set-locus! 3 34 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
;(send M set-locus! 3 35 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
;(send M set-locus! 3 36 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
;(send M set-locus! 3 37 (make-object elemento% 4 3 (make-object olor% 3 10) 255 215 0 1.0))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RAMAL IZQUIERDO
(send M set-locus! 37 34 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 33 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 32 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 31 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 30 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 28 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 27 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 26 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 25 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 24 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 23 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 22 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 21 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 20 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 19 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 18 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 17 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 16 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 15 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 14 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 13 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 12 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 11 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 10 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 9 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 8 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 7 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 40 30 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 28 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 27 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 26 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 25 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 24 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 23 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 22 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 21 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 20 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 19 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 18 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 17 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 16 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 15 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 14 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 13 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 12 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 11 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 10 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 9 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 8 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 7 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 5 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 4 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 39 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 38 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 36 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 35 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 34 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 33 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 32 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 31 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 30 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 29 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 28 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 27 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 26 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 25 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 24 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 23 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 22 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 21 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 20 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 19 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 18 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 17 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 16 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 15 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 13 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 12 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 3 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 37 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 36 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 35 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 34 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 33 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 32 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 31 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 30 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 29 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 28 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 27 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 26 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 25 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 24 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 23 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 22 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 21 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 20 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 19 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 18 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 17 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 16 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 15 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 11 4 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0));;línea superior
(send M set-locus! 11 5 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 7 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 8 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 9 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 10 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 11 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 12 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 13 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 14 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 15 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 16 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 17 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 18 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 19 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 20 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 21 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 22 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 23 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 24 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 25 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 26 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 27 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 28 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 30 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 31 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 32 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 33 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 14 6 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0));línea inferior
(send M set-locus! 14 7 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 8 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 9 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 10 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 11 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 12 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 13 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 14 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 15 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 16 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 17 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 18 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 19 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 20 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 21 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 22 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 23 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 24 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 25 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 26 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 27 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 28 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 29 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 30 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 31 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 32 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 33 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 34 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RAMAL DERECHO
(send M set-locus! 40 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 36 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 37 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 40 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 37 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 36 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 35 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 34 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 33 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 32 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 31 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 30 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 29 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 28 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 27 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 26 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 25 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 24 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 23 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 22 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 21 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 20 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 19 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 18 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 17 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 16 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 15 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 39 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 38 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 37 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 36 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 35 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 34 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 33 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 32 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 31 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 30 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 29 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 28 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 27 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 26 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 25 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 24 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 23 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 22 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 21 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 20 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 19 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 18 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 17 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 16 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 15 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 14 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 13 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 12 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 11 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 10 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 9 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 8 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 7 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 6 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 5 38 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 10 33 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 9 33 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 8 33 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 7 33 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 6 33 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 5 33 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMINO DE SALIDA
(send M set-locus! 40 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 41 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 42 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 43 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 44 35 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

(send M set-locus! 40 31 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 41 31 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 42 31 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 43 31 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))
(send M set-locus! 44 31 (make-object elemento% 5 7 (make-object olor% 6 1) 0 0 255 1.0))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;HORMIGUERO;;salida: 45, 32
(send M set-locus! 48 40 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0));;
(send M set-locus! 48 39 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 38 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 37 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 36 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 35 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 34 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 33 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 32 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 31 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 30 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 29 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 28 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 48 27 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 47 27 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 46 27 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 27 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 28 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 29 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 30 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 31 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 32 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 34 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 35 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 36 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 37 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 38 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 39 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 40 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 45 40 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 46 40 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
(send M set-locus! 47 40 (make-object elemento% 6 8 (make-object olor% 6 1) 132 60 36 1.0))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RASTROS DE FEROMONAS
;;RAMAL DERECHO
;(send M set-locus! 5 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 6 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 7 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 8 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 9 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 10 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 11 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 12 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 13 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 14 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 15 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 16 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 17 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 18 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 19 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 20 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 21 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 22 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 23 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 24 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 25 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 26 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 27 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 28 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 29 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 30 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 31 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 32 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 33 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 34 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 35 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 36 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 37 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 38 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 39 37 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 39 36 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 39 35 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 39 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 39 33 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 40 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 41 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 42 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 43 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 44 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))

;;RAMAL IZQUIERDO
(send M set-locus! 12 5 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 6 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 7 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 8 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 9 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 10 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 11 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 12 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 13 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 14 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 15 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 16 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 17 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 18 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 19 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 20 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 21 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 22 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 23 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 24 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 25 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 26 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 27 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 28 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 29 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 30 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 31 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 32 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 33 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 12 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))

(send M set-locus! 4 33 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;(send M set-locus! 4 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 5 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 6 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 7 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 8 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 9 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 10 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 11 34 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))

(send M set-locus! 12 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 13 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 14 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 15 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 16 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 17 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 18 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 19 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 20 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 21 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 22 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 23 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 24 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 25 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 26 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 27 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 28 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 29 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 30 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 31 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 32 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 33 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 34 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 35 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 36 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 37 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 38 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))

(send M set-locus! 39 4 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 5 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 6 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 7 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 8 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 9 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 10 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 11 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 12 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 13 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 14 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 15 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 16 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 17 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 18 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 19 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 20 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 21 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 22 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 23 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 24 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 25 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 26 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 27 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 28 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 29 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 30 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 31 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 39 32 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 40 32 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 41 32 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 42 32 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 43 32 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
(send M set-locus! 44 32 (make-object elemento% 0 0 (make-object olor% 1 30) 255 255 255 1.0))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define ramal-derecho-lugares
  '((4 38)
    (5 37)
    (6 37)
    (7 37)
    (8 37)
    (9 37)
    (10 37)
    (11 37)
    (12 37)
    (13 37)
    (14 37)
    (15 37)
    (16 37)
    (17 37)
    (18 37)
    (19 37)
    (20 37)
    (21 37)
    (22 37)
    (23 37)
    (24 37)
    (25 37)
    (26 37)
    (27 37)
    (28 37)
    (29 37)
    (30 37)
    (31 37)
    (32 37)
    (33 37)
    (34 37)
    (35 37)
    (36 37)
    (37 37)
    (38 37)
    (39 37)
    (39 36)
    (39 35)
    (39 34)
    (40 34)
    (41 34)
    (42 34)
    (43 34)
    (44 34)
    )
  )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(define blancos-en
  (lambda (matriz dimensiones)
    (let rows
      ((i 0)
       (j (car dimensiones))
       (salida '())
       )
      (if (= i j)
          salida
          (let columns
            ((m 0)
             (n (cdr dimensiones))
             )
            (if (= m n)
                (rows (add1 i) j salida)
                (if (equal? (list 255 255 255 1.0)
                            (send
                             (send M get-obj i m)
                             get-rgb))
                    (begin
                      (set! salida (cons (cons i m) salida))
                      (columns (add1 m) n)
                      )
                    (columns (add1 m) n))
                )
            )
          )
      )
    ))
(define ubica-animat
  (lambda (animat)
    (let* 
        ((hay-blancos
          (blancos-en (send M get-matriz) (send M get-dimensiones)))
         (azar (random (length hay-blancos)))
         (locus (list-ref hay-blancos azar))
         )
      (send M set-locus! (car locus) (cdr locus) animat)
      locus
      )
    ))
;(ubica-animat H1)
;(ubica-animat A2)
                
(provide M hormiga%)
