Results 1 to 11 of 11

Thread: Little programming challenge

  1. #1

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181

    Little programming challenge

    Hey everyone
    well download the little attachement and try if you write a code that will produce the same...
    (this is just the first version I think I will put something else up soon, if I find some time)

    a little hint:
    This is really simple (you might have done it in some programming class in school), don't think about any heavy math solution... I programmed this within 5 minuntes.

    and if you wanna try this use the getpixel and setpixel api, using pset will be to slow for most machines...
    Attached Files Attached Files
    Sanity is a full time job

    Puh das war harter Stoff!

  2. #2

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    alright I attached a picture so you can take a quick look

    the pattern can be changed completely with hardly any code change...
    (I chose this pattern because it is the clearest one so it's easy to analyze it)
    Attached Images Attached Images  
    Sanity is a full time job

    Puh das war harter Stoff!

  3. #3
    Zaei
    Guest
    Its a Sierpinski gasket =).

    Shall I include the method? =).

    Hint: Recursion.

    Z.

  4. #4

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    on my first post I was thinking about asking for Zaei not to tell everyone how it works...

    I did not know that it is a siepinski gasket...
    it is a cellular automat to me....
    Sanity is a full time job

    Puh das war harter Stoff!

  5. #5
    VirtuallyVB
    Guest
    Although they are probably all related, it reminded me of this technique that Stephen Wolfram is trying to use to make an equation for the universe or some such in his lates research.

    Supposed to be based on a type of seed and then applying simple rules, it generates a pattern.

  6. #6

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    haha you know what? I learned about those automats some time ago, but reading a review about Wolframs book "a new science" I believe it is, made me write this
    Last edited by /\/\isanThr0p; Jun 16th, 2002 at 02:50 PM.
    Sanity is a full time job

    Puh das war harter Stoff!

  7. #7
    Addicted Member Janus's Avatar
    Join Date
    Aug 2001
    Location
    California
    Posts
    221
    Is it alright to use C or do we have to use VB?
    "1 4m 4 1337 #4xz0r!'
    Janus

  8. #8
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    I'm doing it in SQL....
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  9. #9
    Addicted Member Janus's Avatar
    Join Date
    Aug 2001
    Location
    California
    Posts
    221
    Well, I had it done like 4 hours ago, but vbforums.com went down.

    Anyway, here it is. Fully commented, very optimized, and at least decently readable :P
    "1 4m 4 1337 #4xz0r!'
    Janus

  10. #10

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    alright I guess I can't post my code
    I did not intend to go for Sierpinski I just programmed a cellular automat and played around and since I rembered having seen this one before I posted this... .
    well my code is pretty crappy I guess...
    Sanity is a full time job

    Puh das war harter Stoff!

  11. #11

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    I am impressed Janus...
    (I guess I posted this for some beginners to give it some thought, but well you posted a great example on how to work with pixels and stuff... all I did in my code was getpixel in the line above and if its white do that if not do that....all simple (and slow))
    Sanity is a full time job

    Puh das war harter Stoff!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width