Thread: How to implement FractalDrawer - C++

  1. #1
    Registered User
    Join Date
    Nov 2019
    Posts
    135

    How to implement FractalDrawer - C++

    Hey.

    I have to implement some FractalDrawer project using inheritance and std::vector. I have described the details of the exercise here:
    Fractal Drawer Project - STL and OOP - C++

    Each fractal consists of a single white-space or #'s.

    For example, we have Sierpinsky Carpet fractal whose "base" (n=1) form (3X3 grid; BTW, the other fractals are also squares) is:
    Code:
    ### 
    # # 
    ###
    So I need an abstract class of Fractal which has to hold vector of Fractal object too, as each cell of the grid is actually the same fractal grid but of a lower order (n-1).

    So, in this example, if I would like to print a Sierpinsky Carpet fractal of order 2, then each of its base form's cells is actually the grid of the same fractal of order 1! Thus:
    Code:
    #########
    # ## ## #
    #########
    ###   ###
    # #   # #
    ###   ###
    #########
    # ## ## #
    #########
    But, I'm really really struggling to write some actual code, I don't know if anything of my declarations is legal, if really needed.

    For example, I'm not sure it's correct at all to declare inside the abstract class of Fractal a std::vector<Fractal> which holds the same data type which is now declared.
    Don't know which constructor do I have to declare... How the print function has to be performed.

    I'm really bad at OOP, as always.

    Can someone maybe guide me/help me somehow with that?

    Thanks in advance.
    Last edited by HelpMeC; 3 Weeks Ago at 07:15 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. is it possible to implement it in this way
    By letmoon in forum C++ Programming
    Replies: 4
    Last Post: 03-22-2012, 01:09 PM
  2. how to implement in C++
    By nageshrk1 in forum C++ Programming
    Replies: 7
    Last Post: 02-20-2010, 01:16 PM
  3. Replies: 9
    Last Post: 11-12-2007, 03:29 PM
  4. how do i implement IOleCommandTarget
    By hanhao in forum Windows Programming
    Replies: 1
    Last Post: 06-24-2007, 10:33 PM
  5. What should I Implement next?
    By cboard_member in forum C++ Programming
    Replies: 4
    Last Post: 03-14-2006, 11:37 AM

Tags for this Thread