{"size": 1741, "ext": "scrbl", "max_stars_repo_path": "scribblings/turtles.scrbl", "max_stars_repo_name": "rfindler/lindenmayer", "max_stars_repo_stars_event_min_datetime": "2017-02-27T02:00:48.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-22T13:11:44.000Z", "max_issues_repo_path": "scribblings/turtles.scrbl", "max_issues_repo_name": "rfindler/lindenmayer", "max_issues_repo_issues_event_min_datetime": "2019-04-09T17:47:16.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-02T15:19:02.000Z", "max_forks_repo_path": "scribblings/turtles.scrbl", "max_forks_repo_name": "rfindler/lindenmayer", "max_forks_repo_forks_event_min_datetime": "2017-03-05T03:32:59.000Z", "max_forks_repo_forks_event_max_datetime": "2021-01-16T23:58:11.000Z"}
{"max_stars_count": 24, "max_issues_count": 2, "max_forks_count": 4, "avg_line_length": 26.3787878788, "max_line_length": 95, "alphanum_fraction": 0.6593911545}
#lang scribble/doc

@(require (for-label lindenmayer/turtle (only-in pict pict?))
          pict racket/runtime-path scribble/manual scribble/base
          "deflsymbol.rkt")


@title{2D L-system turtles}

@defmodule[lindenmayer/turtle]


@racketmodname[lindenmayer/turtle] provides support for 2D
turtle graphics in L-systems.

@deflsymbol[(F () (len _ ...))
            ([len real?])]{
 Moves the turtle forward and draws a line.

 If @racket[len] is supplied, the turtles moves that distance (negative values move backwards).
 If @racket[len] is not supplied, @racket[F] checks for a variable named @litchar{l} and uses
 its value.
 Otherwise, it moves two steps forward.
}


@deflsymbol[(f () (len _ ...))
            ([len real?])]{
 Like @racket[F], but does not draw a line.
}

@deflsymbol[(- () (_ ...)) ()]{
 Rotates the turtle counterclockwise. It rotates by @racket[θ] degrees if that variable is
 defined, and by @racket[90] degrees otherwise.
}

@deflsymbol[(+ () (_ ...)) ()]{
 Like @racket[-], but rotates clockwise.
}

@deflsymbol[(|/| () (width _ ...))
            ([width (and/c real? positive?)])]{
 Set the turtle line drawing with. The default @racket[width] is @racket[1].
}

@deflsymbol[(|[| () (_ ...)) ()]{
 Save the current turtle state.
}

@deflsymbol[(|]| () (_ ...)) ()]{
  Restore the turtle to the state of the matching @racket[\[].
}

@defproc[(start [variables hash?]) turtles?]{
 Creates an initial, with the turtle facing
 to the right.
}

@defproc[(finish [variables hash?] [turtles turtles?]) pict?]{
  Turns the given @racket[turtles] into a pict.
}

@defparam[scale-final? scale? boolean? #:value #t]{
 Determines if @racket[finish] scales the resulting pict so that
 it fits in a 300x300 rectangle. 
}