Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

diamond-cli

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

🔷 Diamond Pattern Generator

This is a simple CLI Delphi program that draws different types of diamond shapes based on user input (as positive int).

  1. Filled diamond using * characters.
  2. Number-based symmetrical diamond.
  3. Alphabet-based symmetrical diamond.
  4. Unfilled (hollow) diamond using * characters.

Requirements

  • Delphi compiler.

Running

  1. Open the project in your Delphi IDE or compile it via CLI.
  2. Then just run.
  3. When prompted, enter a positive integer to define the size of the diamond.

🧾 Sample Input and Output

Input:

pascal
Please enter the size of the diamond shape (Enter -1 to stop): 3

Output:

bash
Filled Diamond with *:
  *
 ***
*****
 ***
  *

Diamond with Numbers:
  1
 121
12321
 121
  1

Diamond with Letters:
  A
 ABA
ABCBA
 ABA
  A

Unfilled Diamond with *:
  *
 * *
*   *
 * *
  *