1 Replies - 257 Views - Last Post: 03 February 2011 - 06:46 PM

#1 redchannel  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 69
  • Joined: 05-October 10

recursion

Posted 03 February 2011 - 06:29 PM

I am trying to create a recursive program that will print a square with the given demensions and fill character provided by the user. The function retrieves the demensions and the fill character for the square but I have no idea how to print out the actual spuare.

here is an example of whatthe square is suppose to look like:




%%%%%%%%%%
%%%%%%%%%%
%%%%%%%%%%
%%%%%%%%%%
%%%%%%%%%%

What I'm wanting to do is have the function print the fill character as may times as the width says and that same line printed for however manytimes the hieght is.

How would I set up a base case ?

Is This A Good Question/Topic? 0
  • +

Replies To: recursion

#2 newclearner  Icon User is offline

  • D.I.C Regular

Reputation: 103
  • View blog
  • Posts: 302
  • Joined: 29-September 10

Re: recursion

Posted 03 February 2011 - 06:46 PM

Have you written any code so far?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1