#lang racket (require "xml.rkt") (define-tag svg) (define-tag defs) (define-single-tag circle) (define-single-tag rect) (define-single-tag line) (define-single-tag use) (define-tag clipPath) (displayln (let ([doc-width 100] [doc-height 100] [stone-radius 5] [black-colour "#222222"] [white-colour "#DDDDDD"] [stone-border 1] [board-edge 2] [board-colour "#F9D77D"] [edge-colour "#000000"]) (svg ([xmlns:xlink "http://www.w3.org/1999/xlink"] [width doc-width] [height doc-width]) (defs () (clipPath ([id "board-clip"]) (rect ([width doc-width] [height doc-height]))) (circle ([id "black-stone"] [cx 0] [cy 0] [r stone-radius] [stroke-width stone-border] [stroke white-colour] [fill black-colour])) (circle ([id "white-stone"] [cx 0] [cy 0] [r stone-radius] [stroke-width stone-border] [stroke black-colour] [fill white-colour]))) (rect ([width doc-width] [height doc-height] [stroke edge-colour] [clip-path "url(#board-clip)"] [stroke-width (* 2 board-edge)] [fill board-colour])) (map (lambda (x) (use ([xlink:href "#black-stone"] [x (+ (/ doc-width 2) (* 30 (cos (/ (* x pi) 180))))] [y (+ (/ doc-height 2) (* 30 (sin (/ (* x pi) 180))))]))) (range 0 360 40))))) (provide (all-defined-out))