Baklava in Every Language

Published on 01 November 2018 (Updated: 02 November 2018)

Baklava in Every Language

In this article, we’ll introduce the Baklava project, its requirements, and how to test it.

Description

Baklava is a Turkish dessert, and its shape is like an equilateral quadrangle. It is used as an example for programming education in Turkish schools.

In general, this solution can be accomplished using a pair of loops. Of course, all possible programs are welcome.

Requirements

The following is the expected output (it isn’t mandatory to use ‘*’, any symbol or character can be used):

           *
          ***
         *****
        *******
       *********
      ***********
     *************
    ***************
   *****************
  *******************
 *********************
  *******************
   *****************
    ***************
     *************
      ***********
       *********
        *******
         *****
          ***
           *
  1. The shape should be symmetrical both horizontally and vertically
  2. Each subsequent line should either add or remove padding by one character on both sides
  3. Whitespace should be adjusted accordingly in order to properly output the shape

Testing

Verify that the actual output matches the expected output (see requirements)

Articles

Currently, there are no articles. If you’d like to begin contributing, head over to the repo to get started.

Further Reading