All pastes #2048663 Raw Edit

Unnamed

public text v1 · immutable
#2048663 ·published 2011-04-20 15:30 UTC
rendered paste body
(define (place-queen board i j)
  (let
      ; copy the board that is got from function.
      ; I will change it via (vector-set!) and return it
      [(output board)]
    
    (begin
      ; set the queen
      (vector-set! (vector-ref output i) j 'q)
      ; set the positions that it is threatening
      (for-each (lambda (item)
             ; (car item) is column
             ; (cadr item) is row
             (vector-set! (vector-ref output (car item)) (cadr item) #f))
                (get-threatened-positions (vector-length board) i j))
      output)))