Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,15 @@
(define-values (K Q R B N) (iota 5))
(define *pos* (list R N B Q K B N R)) ;; standard starter
;; check opposite color bishops, and King between rooks
(define (legal-pos p)
(and
(> (list-index K p) (list-index R p))
(> (list-index K (reverse p)) (list-index R (reverse p)))
(even? (+ (list-index B p) (list-index B (reverse p))))))
;; random shuffle current position until a legal one is found
(define (c960)
(set! *pos* (shuffle *pos*))
(if (legal-pos *pos*)
(map unicode-piece *pos*) (c960)))