librelist archives

« back to archive

A repo on github with some shoes info

A repo on github with some shoes info

From:
Douglas Allen
Date:
2013-03-09 @ 22:25
Hi gang,
checkout https://github.com/CoderDojoSF/graphics-and-animations for
what could be fun and learning.

Re: [shoes] A repo on github with some shoes info

From:
ashbb
Date:
2013-03-09 @ 23:12
Hi Douglas,

Wow, good to know. That's cool!

Thank you for always,
ashbb

Re: [shoes] A repo on github with some shoes info

From:
J. Kaiden
Date:
2013-03-10 @ 02:04
hi Douglas,

  cool!  let's spread the shoes word...

  - j


On Sun, Mar 10, 2013 at 12:12 AM, ashbb <ashbbb@gmail.com> wrote:

> Hi Douglas,
>
> Wow, good to know. That's cool!
>
> Thank you for always,
> ashbb
>

Re: [shoes] A repo on github with some shoes info

From:
Douglas Allen
Date:
2013-03-10 @ 09:27
Also for your mandelbrot ashbb could this little bit be applied?
require 'complex'

def mandelbrot(a)
  Array.new(ITERATIONS, a).inject(a) { |z,c| z*z + c }
end

Re: [shoes] A repo on github with some shoes info

From:
Douglas Allen
Date:
2013-03-10 @ 09:28
mandelbrot(Complex(x,y)).abs < 2

On Sun, Mar 10, 2013 at 4:27 AM, Douglas Allen <kb9agt@gmail.com> wrote:
> Also for your mandelbrot ashbb could this little bit be applied?
> require 'complex'
>
> def mandelbrot(a)
>   Array.new(ITERATIONS, a).inject(a) { |z,c| z*z + c }
> end

Re: [shoes] A repo on github with some shoes info

From:
Douglas Allen
Date:
2013-03-10 @ 09:31
This from
http://blog.mostof.it/mandelbrot-set-in-ruby-and-haskell/

On Sun, Mar 10, 2013 at 4:28 AM, Douglas Allen <kb9agt@gmail.com> wrote:
> mandelbrot(Complex(x,y)).abs < 2
>
> On Sun, Mar 10, 2013 at 4:27 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>> Also for your mandelbrot ashbb could this little bit be applied?
>> require 'complex'
>>
>> def mandelbrot(a)
>>   Array.new(ITERATIONS, a).inject(a) { |z,c| z*z + c }
>> end

Re: [shoes] A repo on github with some shoes info

From:
Douglas Allen
Date:
2013-03-10 @ 09:51
And aaah the magic of Ruby.
you have
def mandelbrot a, b
    x, y = 0.0, 0.0
    MAX.times do |i|
      x, y = x * x - y * y - a, 2.0 * x * y - b
      return [x, y, i] if (x * x + y * y) > 4.0
    end
    [x, y, false]
  end

And so here is http://en.wikipedia.org/wiki/Mandelbrot_set
showing pseudocode so just for readability
I tried
def mandelbrot a, b
    x, y = 0.0, 0.0
    MAX.times do |i|
       if (x * x + y * y) < 4.0
          xtemp = x * x - y * y - a
          y = 2.0 * x * y - b
          x = xtemp
          return [x, y, i]
       else
         return [x, y, false]
    end
  end

It seems to work the same.
Perhaps explain how your > 4 and lack of a x temp does this?
It would seem that with out the x temp x could get changed before
evaluating the y.
How does Ruby overcome this in your code? I'm sure it is something
like scope but it is so
close being in the same line of code that I can't be sure. Are you
trying to obfuscate this?
But this is a great project and I have done something like this in the
past with BASIC.
There should be shell looking ovals around the gingerbread man though.
Are you sure something isn't backwards to us US folk?
Thanks.

On Sun, Mar 10, 2013 at 4:31 AM, Douglas Allen <kb9agt@gmail.com> wrote:
> This from
> http://blog.mostof.it/mandelbrot-set-in-ruby-and-haskell/
>
> On Sun, Mar 10, 2013 at 4:28 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>> mandelbrot(Complex(x,y)).abs < 2
>>
>> On Sun, Mar 10, 2013 at 4:27 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>>> Also for your mandelbrot ashbb could this little bit be applied?
>>> require 'complex'
>>>
>>> def mandelbrot(a)
>>>   Array.new(ITERATIONS, a).inject(a) { |z,c| z*z + c }
>>> end

Re: [shoes] A repo on github with some shoes info

From:
Douglas Allen
Date:
2013-03-10 @ 10:33
> There should be shell looking ovals around the gingerbread man though.

See slide starting at 171 here http://www.rubyist.net/~matz/

Re: [shoes] A repo on github with some shoes info

From:
Douglas Allen
Date:
2013-03-11 @ 00:42
http://www.ntecs.de/blog/articles/2003/05/19/julia-sets/

Re: [shoes] A repo on github with some shoes info

From:
Douglas Allen
Date:
2013-03-11 @ 00:50
Ruby may bring us closer together if this is true:
http://www.docstoc.com/docs/78582624/Sapir-Whorf-Hypothesis-vs-Universalism

Re: [shoes] A repo on github with some shoes info

From:
J. Kaiden
Date:
2013-03-11 @ 01:00
very interesting links - thanks for sharing them...


On Mon, Mar 11, 2013 at 1:50 AM, Douglas Allen <kb9agt@gmail.com> wrote:

> Ruby may bring us closer together if this is true:
> http://www.docstoc.com/docs/78582624/Sapir-Whorf-Hypothesis-vs-Universalism
>

Re: [shoes] A repo on github with some shoes info

From:
Douglas Allen
Date:
2013-03-12 @ 02:05
http://rosettacode.org/wiki/Mandelbrot_set#Ruby

Re: [shoes] A repo on github with some shoes info

From:
Douglas Allen
Date:
2013-03-12 @ 02:07
At this point I think the hardest thing to do with the shoes version
is to remap the coordinates for the screen. Not as easy as QBASIC was.