Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8892441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:59:53+00:00 2026-06-14T22:59:53+00:00

Using processing and recursion, I’m trying to draw a similar shape to this: But

  • 0

Using processing and recursion, I’m trying to draw a similar shape to this:
http://i.imgur.com/OPf5D.png

But I feel like I’m losing my mind trying every possible way to draw the shape. This is closest I’ve gotten: http://i.imgur.com/vCHJG.png

Plus my code, any help would be appreciated. Thanks:

void setup(){
  size(600,600);
}

void draw(){
  background(255);
  draws(300, 300, 50, 5);
}

void draws(int x, int y, int x2, int num){
  stroke(0);
  strokeWeight(2);
  line (x, y, (x+x2), y); //right
  line(x, y, x, y-50); //right up
  line (x-x2, y, x-(x2*2), y); // left 
  line(x-x2, y, x-x2, y-50); //left up 
  line (x, y-50, x-x2, y-50); //top 

  if(num>0){
    draws(x-x2, y-x2, x2/2, num-1);
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:59:55+00:00Added an answer on June 14, 2026 at 10:59 pm

    I got it! Thanks for the help.

    Here is the meat of it, everything else was fine:

    line(x, y, x, y-x2); //right

    line(x-x2, y, x-x2, y-x2); //left

    if (num>0) {

    draws(x-(x2/3), y-x2, x2/3, num-1); // Central one  
    
    draws(x+(x2/1.5), y, x2/3, num-1); // right one  
    
    draws(x-(x2*1.33), y, x2/3, num-1); // left one
    

    }

    if (num==0) { //If there are no more instances, draw the horzontal lines

    line (x, y, (x+x2), y); //right
    
    line (x-x2, y, x-(x2*2), y); // left 
    
    line (x, y-x2, x-x2, y-x2); //top 
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(I'm using the pyprocessing module in this example, but replacing processing with multiprocessing should
I have a HashMap that I'm using in Processing and I'd like to increment
I'm trying to model a asynchronous job processing framework using MailboxProcessor. My requirements are
I want to write an application using processing-JS , and I'd like to be
I'm playing with shaders in openGL using Processing. I'm pretty noob at this and
I'm trying to make a sketchpad using Processing.js. My code is not throwing any
I'm using the Processing language to do a little game, but I'm having trouble
I've been using Processing for around two years now, and I really like it.
I am trying to insert a character into a string using Processing. After some
Not a very common implementation, but using Processing as a Java Servlet has been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.