Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
config
lib/fract
test
.gitignore
README.md
mix.exs

README.md

Fract

Solution for Weekly Programming Challenge #14 by Jamis Buck.

See: http://weblog.jamisbuck.org/2016/10/29/weekly-programming-challenge-14.html

Problem text:

Normal Mode

For normal mode (and one point), here’s all you’ve got to do:

  1. Given a starting statement and a set of rules, recursively perform the substitutions required by the rules. You must be able to specify how many times the substitutions will be performed.
  2. Draw the resulting statement! The only commands you need to support are “F” (move forward), “+” (turn right), and “-“ (turn left). You should be able to specify how much a “+” and “-“ will turn the turtle.
  3. Produce an image with the finished drawing.

That’s it! You’re going to have to tackle some math to make this work, and figuring out how large your canvas needs to be may be a bit of a puzzle, but it can be done! Try the dragon curve (above) as a test.