#lang racket/base

; Hard-coded generator
; Generate 2d-arrays from hard-coded representations
(require
  racket/string
  "../../collection/2d-array.rkt"
  "cell.rkt")

(provide
  yggdrasil-hard-coded-generate)

; Conversion from a hard-coded list of strings
(define (yggdrasil-hard-coded-generate strlst)
  (define height (length strlst))
  (define width (string-length (car strlst)))
  (define charvec (string-join strlst ""))
  ;
  (build-2d-array
    width
    height
    (lambda (i j)
      (character->yggdrasil-cell
        (string-ref charvec (+ i (* j width)))))))
