-  [JOIN IRC!]


[Return]
Posting mode: Reply
Name
Subject   (reply to 439)
Message
File
Password  (for post and file deletion)
¯\(°_O)/¯
  • Supported file types are: BMP, GIF, JPG, PNG
  • Maximum file size allowed is 10000 KB.
  • Images greater than 400x400 pixels will be thumbnailed.
  • Currently 317 unique user posts. View catalog

  • Blotter updated: 2015-09-02 Show/Hide Show All


File 138787528956.png - (71.85KB , 803x739 , 1387766974001.png )
439 No. 439
Programming challenge: Write a quick program that will draw a Sierpinski triangle using a recursive or iterative process.

This is my attempt. Each line is described by an array of booleans. The next line is generated by taking the XOR of consecutive elements in the array.

http://pastebin.com/MvwHcgm7
Expand all images
>> No. 440
File 138790667397.png - (6.65KB , 459x697 , sierpinski text.png )
440
Used a bit shift and XOR to create the lines.

http://pastebin.com/J84hmZ45
>> No. 449
>>440

That's awesome.
>> No. 450
File 139048049598.png - (9.27KB , 931x699 , fat sierpinksi.png )
450
>>449

I've got a symmetrical version here:

http://pastebin.com/XA1KHYbE
>> No. 529
File 140643415953.png - (46.61KB , 800x600 , figure_1.png )
529
here's one that lets the PRNG do most of the work

http://pastebin.com/kc7pDF4M
>> No. 653
File 141599426880.jpg - (12.08KB , 200x200 , 1415840371504.jpg )
653
can i just hire an Indian to do this for me?


Delete post []
Password  
Report post
Reason