lukeh put out an elegant F# mandelbrot program, that gives this output to the console: #
####
####
# ##########
#################
###################
#####################
####### ######################
######### ######################
#############################################
######### ######################
####### ######################
#####################
###################
#################
# ##########
####
####
#
i tinkered with it, just to see if i could understand how it was working...
I turned the output into this:
000000000000001111111111111111111111111111111111111111111111111111
000000000000111111111111111111111111111111111111111111111111111111
000000000011111111111111122222222222111111111111111111111111111111
000000001111111111222222222222222222222222211111111111111111111111
000000011111112222222222222222333334974433322221111111111111111111
000000111112222222222222222333333445698994333322221111111111111111
000001112222222222222222333333344457899975443333222221111111111111
000011222222222222222233333334455679 97544443322222211111111111
000112222222222222233333344567777899 99875559433222221111111111
001122222222222223333444455699 99 99999943222222111111111
001222222222223344444445557999 9654322222211111111
0122222223334469666666666799 9894332222221111111
022233333344456999999998899 975332222222111111
02333333444456799 99 964333222222111111
0333335555679999 9 754333222222111111
0 97654333222222111111
0333335555679999 9 754333222222111111
02333333444456799 99 964333222222111111
022233333344456999999998899 975332222222111111
0122222223334469666666666799 9894332222221111111
001222222222223344444445557999 9654322222211111111
001122222222222223333444455699 99 99999943222222111111111
000112222222222222233333344567777899 99875559433222221111111111
000011222222222222222233333334455679 97544443322222211111111111
000001112222222222222222333333344457899975443333222221111111111111
000000111112222222222222222333333445698994333322221111111111111111
000000011111112222222222222222333334974433322221111111111111111111
000000001111111111222222222222222222222222211111111111111111111111
000000000011111111111111122222222222111111111111111111111111111111
000000000000111111111111111111111111111111111111111111111111111111
000000000000001111111111111111111111111111111111111111111111111111
000000000000000011111111111111111111111111111111111111111111111100
I think i'm getting the hang of it!
I love learning by doing... you change a little bit and then you run it again... then you tweak something else and you see what happens...
Here's my minor variation on luke's code Only difference:
i noticed he was saying "a * a" in one place, which is very cumbersome and repetitive [ ;-) ] -- so i implemented a custom 'squared' operator in there, using this name for the operator: '!!!!!@**'
Now instead of getting sore wrists typing out something as long winded and error prone as "a * a", i could simply say ( !!!!!@** a ) and F# would treat this as a * a.
Also, i reversed the 'colours', showing how many iterations it takes the function to 'escape' the inner circle from a given point. (i did know some maths stuff once upon a time y'know).
(I wrote a 'min' function in there too. i know there'd be one implemented already, but i'm trying to do simple tinkering here ;-) )
Your mission!
Next step: do the same thing rendering pixels to a bitmap instead... then i could try breaking that up amongst multiple cores... no... sleep time.
The interested reader is invited to finish this problem for me ;-)