Home Forums Register FAQ Members List Calendar Search Today's Posts Mark Forums Read Arcade Chat
Go Back   ClubPenguinHQ Forums > General Discussion > Programming > Released Projects
Reload this Page java serpenski triangle
Released Projects Made any cool programs lately? Post them here!

java serpenski triangle

Reply
 
LinkBack Thread Tools Display Modes
java serpenski triangle
Old
  (#1)
madaco is Offline
Member
madaco has a little shameless behaviour in the past
 
Posts: 175
Join Date: Mar 2009
Location: on the computer in a house, sometimes i travel tooter parts of the house, like my bed
Rep Power: 0
   
Default java serpenski triangle - Saturday, September 19th, 2009

i made a java serpenski triangle at a tech camp this summer(just now getting it off the cd) and i thought I'd show you,( and hope i dont get mocked for its simplicity, i learned all the java I know in the week i made this)

Code:
	
	import processing.core.PApplet;
import processing.core.PImage;



	public class serpenskifix extends PApplet {
		int xsize = 1280;
		int ysize = 900;
		public void setup()
		{ 
		    size(1280, 1000);
		    noLoop();
		}
		public void draw()
		{
			PImage b;
			b = loadImage("link.bmp");
			background(b);
			//int tripos[][] = new int[2][3];
			sierpinski(0,ysize,xsize/2,0,xsize,ysize,7,0);
		}
		public void sierpinski(int x1, int y1, int x2, int y2, int x3, int y3, int depth, float colour)
		{
			if (depth<0)
			{
				stroke(255,255,0);
				fill(255,255,0);
				triangle(x1,y1,x2,y2,x3,y3);
				return;
			}
			else
			{
				depth=depth-1;
				sierpinski(x1,y1,(x1+x2)/2,(y1+y2)/2,(x1+x3)/2,(y1+y3)/2,depth,colour);
				sierpinski((x1+x2)/2,(y1+y2)/2,x2,y2,(x2+x3)/2,(y2+y3)/2,depth,colour);
				sierpinski((x1+x3)/2,(y1+y3)/2,(x2+x3)/2,(y2+y3)/2,x3,y3,depth,colour);
			}
			}
		}
thats the main part of it, but theres other files, that I think are required for it to work, and one that i know is required to work(core.jar) so I uploaded it to www.madaco.net/asmodes.zip (i sometimes name random things as the name of a snake in the redwall series, thats why it has the project name that it does)

I hope its not overly simple.

EDIT: i know this place is either dead or about to die, but isnt this post of mine at least borderline interesting enough to respond to?
can someone please respond with suggestions or critisism, or acknowlage that i made this topic in some way?


vote docter octagonapus for president 2012 (sig started by a person( who might be me))

can someone please look at my thread on the serpenski triangle, and maybe say something about it? it can be negitive...

Last edited by madaco; Sunday, September 20th, 2009 at 02:34pm.
  
Reply With Quote
Old
  (#2)
wweice is Offline
Senior Member
wweice
 
wweice's Avatar
 
Posts: 877
Join Date: Feb 2009
Age: 12
Rep Power: 0
  Send a message via AIM to wweice Send a message via MSN to wweice Send a message via Yahoo to wweice  
Default Wednesday, September 23rd, 2009

So wtf does this do?


Quote:
Originally Posted by Steven View Post
Goodbye, yomaster. Good luck in your future.

May the Lord be with you.
  
Reply With Quote
Old
  (#3)
madaco is Offline
Member
madaco has a little shameless behaviour in the past
 
Posts: 175
Join Date: Mar 2009
Location: on the computer in a house, sometimes i travel tooter parts of the house, like my bed
Rep Power: 0
   
Default Wednesday, September 23rd, 2009

it makes an image of a yellow serpenski triangle, with a green background with a picture of 8bit link taken from a cake in the middle. the variable depth changes how many time it recurses(it uses recursion)

and thank you very much for responding!


vote docter octagonapus for president 2012 (sig started by a person( who might be me))

can someone please look at my thread on the serpenski triangle, and maybe say something about it? it can be negitive...
  
Reply With Quote
Old
  (#4)
rile5 is Offline
Senior Member
rile5 will become famous soon enough
 
rile5's Avatar
 
Posts: 861
Join Date: Jul 2007
Rep Power: 14
  Send a message via MSN to rile5  
Default Thursday, September 24th, 2009

Nice Javascript





  
Reply With Quote
Old
  (#5)
madaco is Offline
Member
madaco has a little shameless behaviour in the past
 
Posts: 175
Join Date: Mar 2009
Location: on the computer in a house, sometimes i travel tooter parts of the house, like my bed
Rep Power: 0
   
Default Thursday, September 24th, 2009

thank you!( but its java, was that a typo?) did you run it, or just look at it and determine whether it would work well?
again thaink you for the complement and for responding.


vote docter octagonapus for president 2012 (sig started by a person( who might be me))

can someone please look at my thread on the serpenski triangle, and maybe say something about it? it can be negitive...
  
Reply With Quote
Reply

Lower Navigation
Go Back   ClubPenguinHQ Forums > General Discussion > Programming > Released Projects

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java help xenie357 Other 1 Saturday, January 31st, 2009 09:19am



Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
vBulletin Skin developed by: vBStyles.com
Copyright ©2006 - 2009, RancidKraut Industries