Geeks Gifts: Surprise a Girl with ASCII Art Flowers Program

Geeks Gifts: Surprise a Girl with ASCII Art Flowers Program

I like to make surprises and gifts to the people I value or want to impress. I rarely do them because I expect something in return. One reason for that is that I enjoy the creativity process. Usually, the result is a unique present. When I give/send it to the target person, usually he/she really likes it. Most people lack creativity and give gifts to their (girl/boy)friends only when there is some special occasion. Usually, these presents are trivial- flowers, chocolate bonbons, plush toys, etc. So I decided to create a new series dedicated to giving you more creative ideas- Geeks Gifts Series.

Quick Navigation

What Is the Gift’s Idea?

ASCII Art Flowers Program Code

Simple Version

Improved Version

Finish the Surprise- Add an Icon

Get Instant Access to the latest Source CODE

What Is the Gift’s Idea?

It was Valentines Day, and I wanted to create something interesting for a girl. I buy flowers too, but it is too banal. So I decided to create an application that displays flowers in a unique way. When the girl types a letter from her name, the program shows a flower in a different color. The cool stuff here is that it was an old-school console app.

Console Flowers

ASCII Art Flowers Program Code

I built two versions of the app- a simple and improved one. You can modify them as you like. As you will notice the name of the girl is hard-coded so for obvious reasons, I changed it (it is not Qwert :D).

I love the ASCII art- creating figures with ASCII characters. Of course, I didn’t reinvent the wheel, and I didn’t create the flower images manually. If you google, you will find tonnes of ASCII string pictures. You can find lots of stuff on AsciiiWorld​. 

Simple Version

I had to built the program for half an hour so you understand why the code looks like this.

class Program
{
static void Main(string[] args)
{
// Version 1.0
string flower1 = @"
H H H H H
H H H H H H H H
H H H H H H H
H H H H H H H H H H
H H H H H H H H H H H
H H H H H H H H H H H H
H H H H H H H H H H H
H H H H H H H H H H H
H H H H H H H H H H H H
@ H H H H H H H H H H H H
@ @ H H H H H H H H H H H H H
@ @ H H H H H H H H H H H H H
@ @ @ H H H H H H H H H H H H
@ @ H H H H H H H H H H H H
@ @ @ H H H H H H H H H H @ @
@ @ H H H H @ H H H H H H @ @ @ @ @
@ @ H H H @ @ H H H H H @ @ @ @ @
@ @ @ H H H H @ @ H H H H H @ @ @
@ @ H H H H @ @ H H H H H @ @ @
@ H H H H @ @ @ H H H H H H @ @ @
H H H H @ @ H H H H H H @ @
H H H H @ @ H H H H H @ @ @
@ @ @ H H H H @ @ H H H H H H @ @
@ @ @ @ @ @ H H H @ @ @ H H H H H @ @ @
@ @ @ @ @ H H H @ @ @ H H H H @ @ @
@ @ @ @ @ H H H H @ @ @ H H H H H @ @ @
@ @ @ H H H @ @ @ @ H H H H @ @ @ @
@ @ @ H H H @ @ @ H H H H @ @ @
@ @ @ H H @ @ @ @ H H H @ @
@ @ H H @ @ @ @ H H @ @ @
@ @ @ H @ @ @ @ @ H @ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @
@ @ @ @ @
@ @ @
@ @ @ @ @ @
@ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @
@ @ @ @
@ @ @ @
";
string flower2 = @"
%%%%%%
%%%%%%
&&%%%%%
' %%%%%
' %%%%
'' %%%%
' ' %%%%
' ' %%%%
' ' %%%%
' ~~ ' %%%%
' ~~ ~~ ' %%%%
' ~~~ ~~~ ' %%%%
' ~~~~~ ~~~~ ' %%%%
' ~~~~~ ~~~~~ ' %%%%
' ~~~~~ ~~~~ ' &&&&&&&
` ~~~ ~~~ ' {{}}{{}}{{}}
` ~~~ ~~ ' /
` ~~~ ' / /
` ' /
`' / /
/
/ /
/
/ / /
.... .... ....
||
||
||
o o oo o o
oo oo oo
o o o
";
string flower3 = @"
__ .---.
__ / ` .-.7,--.
/ `. .-''. -, ,
'--.- -; | ) /
,` / ,_) / '-.
/ ( ( | / .' )
'. `--,/ .---' ,-.|
`--. / '-, -' .'
.==,=; `-,.;--'
/ ,' _;--;|
/_...=' ||
jgs || .==,=.
||/ '.
,||`'=...__
||
||
||,
||
||
||
";
string flower4 = @"
.=====__
/==Z' .===_ ~~=,_===
_/ | | YZ, `, ~
| | | _/=j' !, d
__====_| | b/ V`; /' .M ,
`5==/~~ W, t d+, .D4| / /'|/~~~=__ .-
` t~ | |t`~~T/'|Z :/ | ~~=/V
| 4, | ~/~' :Z -! | |
, /__| .! :XG / ._, ./'
`L | ~; V; _//' | .f~' `~; .b_
./ __JL `; Y7~ | / / d //' ,
.! `D, `, | .! .t/ .(_/=~
/ `;`~~~=+=qLb, jK_L==f' j'' `;
./ .(r, `~5' ~,._r/ |
~=m! ./D' `, , !G~ t
~==___===/'/ .!`__ /! __=~~=_ TG=
| .| ~==r@/~5 !, ~=_, __//'
|./~V || `| , t ~~~~==~~
t| | | | | !, =_,
! t .! !, `/~~~
| / !/
`; ./ `~-
t .!
N, ./'
`/'";
string flower5 = @"
.@. .
@m@,. .@
.@m%nm@,. .@m@
.@nvv%vnmm@,. .@mn%n@
.@mnvvv%vvnnmm@,. .@mmnv%vn@,
@mmnnvvv%vvvvvnnmm@,. .@mmnnvvv%vvnm@
@mmnnvvvvv%vvvvvvnnmm@, ;;;@mmnnvvvvv%vvvnm@,
`@mmnnvvvvvv%vvvvvnnmmm;;@mmnnvvvvvv%vvvvnmm@
`@mmmnnvvvvvv%vvvnnmmm;%mmnnvvvvvv%vvvvnnmm@
`@m%v%v%v%v%v;%;%;%;%;%;%;%%%vv%vvvvnnnmm@
.,mm@@@@@mm%;;@@m@m@@m@@m@mm;;%%vvvnnnmm@;@,.
.,@mmmmmmvv%%;;@@vmvvvvvvvvvmvm@@;;%%vvnnm@;%mmm@,
.,@mmnnvvvvv%%;;@@vvvvv%%%%%%%vvvvmm@@;;%%mm@;%%nnnnm@,
.,@mnnvv%v%v%v%%;;@mmvvvv%%;*;*;%%vvvvmmm@;;%m;%%v%v%v%vmm@,.
,@mnnvv%v%v%v%v%v%v%;;@@vvvv%%;*;*;*;%%vvvvm@@;;m%%%v%v%v%v%v%vnnm@,
` `@mnnvv%v%v%v%%;;@mvvvvv%%;;*;;%%vvvmmmm@;;%m;%%v%v%v%vmm@' '
`@mmnnvvvvv%%;;@@mvvvv%%%%%%%vvvvmm@@;;%%mm@;%%nnnnm@'
`@mmmmmmvv%%;;@@mvvvvvvvvvvmmm@@;;%%mmnmm@;%mmm@'
`mm@@@@@mm%;;@m@@m@m@m@@m@@;;%%vvvvvnmm@;@'
,@m%v%v%v%v%v;%;%;%;%;%;%;%;%vv%vvvvvnnmm@
.@mmnnvvvvvvv%vvvvnnmm%mmnnvvvvvvv%vvvvnnmm@
.@mmnnvvvvvv%vvvvvvnnmm'`@mmnnvvvvvv%vvvnnmm@
@mmnnvvvvv%vvvvvvnnmm@':%::`@mmnnvvvv%vvvnm@'
@mmnnvvv%vvvvvnnmm@'`:::%%:::'`@mmnnvv%vvmm@
`@mnvvv%vvnnmm@' `:;%%;:' `@mvv%vm@'
`@mnv%vnnm@' `;%;' `@n%n@
`@m%mm@' ;%;. `@m@
@m@' `;%; `@
`@' ;%;. '
";
var key = new ConsoleKeyInfo();
while (!System.Console.KeyAvailable && key.Key != ConsoleKey.Escape)
{
System.Console.ForegroundColor = ConsoleColor.White;
System.Console.WriteLine();
System.Console.Write("Enter a letter part of your name (Qwert) (quit = ESC): ");
key = System.Console.ReadKey(true);
switch (key.Key)
{
case ConsoleKey.Q:
System.Console.ForegroundColor = ConsoleColor.Red;
System.Console.WriteLine(flower1);
break;
case ConsoleKey.W:
System.Console.ForegroundColor = ConsoleColor.Blue;
System.Console.WriteLine(flower2);
break;
case ConsoleKey.E:
System.Console.ForegroundColor = ConsoleColor.DarkYellow;
System.Console.WriteLine(flower3);
break;
case ConsoleKey.R:
System.Console.ForegroundColor = ConsoleColor.DarkCyan;
System.Console.WriteLine(flower4);
break;
case ConsoleKey.T:
System.Console.ForegroundColor = ConsoleColor.DarkGray;
System.Console.WriteLine(flower5);
break;
default:
if (System.Console.CapsLock && System.Console.NumberLock)
{
System.Console.WriteLine(key.KeyChar);
}
break;
}
}
}
}

First the flowers are presented as strings. Then there is a loop where the girl types a character if it is a letter from her name, the program displays on the console the corresponding flower in different color. It stops once she clicks ESC.

Improved Version

I couldn’t handle the simplicity of the code so I improved the initial version so that it can be more scalable.

FlowersExecutionEngine

I moved the execution of the display logic to this static class.

public static class FlowersExecutionEngine
{
public static void Execute(List<Flower> flowers)
{
var key = new ConsoleKeyInfo();
while (!System.Console.KeyAvailable && key.Key != ConsoleKey.Escape)
{
System.Console.ForegroundColor = ConsoleColor.White;
System.Console.WriteLine();
System.Console.Write(value: "Enter a letter part of your name (Qwert) (quit = ESC): ");
key = System.Console.ReadKey(intercept: true);
Flower flowerToBePrinted = flowers.FirstOrDefault(f => f.Letter == key.Key);
flowerToBePrinted?.Print();
}
}
}

Base Flower

Now every flower should have the ASCII image, a color and a letter. The Print method changes the foreground color of the console and prints the flower image to it.

public abstract class Flower
{
public Flower(ConsoleColor color, ConsoleKey letter)
{
this.Color = color;
this.Letter = letter;
}
public abstract string FlowerPicture { get; }
public ConsoleColor Color { get; set; }
public ConsoleKey Letter { get; set; }
public void Print()
{
System.Console.ForegroundColor = this.Color;
System.Console.WriteLine(this.FlowerPicture);
}
}

Concrete Flower

The concrete flower classes only override and assign the ASCII flowers’ images.

public class TypeThreeFlower : Flower
{
public TypeThreeFlower(ConsoleColor color, ConsoleKey letter) : base(color, letter)
{
}
public override string FlowerPicture
{
get
{
return @"
__ .---.
__ / ` .-.7,--.
/ `. .-''. -, ,
'--.- -; | ) /
,` / ,_) / '-.
/ ( ( | / .' )
'. `--,/ .---' ,-.|
`--. / '-, -' .'
.==,=; `-,.;--'
/ ,' _;--;|
/_...=' ||
jgs || .==,=.
||/ '.
,||`'=...__
||
||
||,
||
||
||
";
}
}
}

Program

The main program body is now shorter compared to the initial version. You need to create all of the flowers and pass them to the flowers execution engine.

class Program
{
static void Main(string[] args)
{
// Version 2.0
var flowers = new List()
{
new TypeOneFlower(ConsoleColor.Red, ConsoleKey.Q),
new TypeTwoFlower(ConsoleColor.Blue, ConsoleKey.W),
new TypeThreeFlower(ConsoleColor.DarkYellow, ConsoleKey.E),
new TypeFourFlower(ConsoleColor.DarkCyan, ConsoleKey.R),
new TypeFiveFlower(ConsoleColor.DarkGray, ConsoleKey.T),
};
FlowersExecutionEngine.Execute(flowers);
}
}

Finish the Surprise- Add an Icon

In order your surprise to look more complete you need to change the icon for your app. You will find lots of sites for free icons. For example- FlatIcon​. After you, download the most appropriate one, open the properties of the project file and change the icon from the Application tab (Resources section).

Add an Icon Flowers Console Surprise

[xyz-ihs snippet=”Geeks-Gifts-Ads-Placeholder”]

@media (min-width: 300px){[data-css=“tve-u-1886173d6fe”] .tcb-button-link{letter-spacing: 2px;border-radius: 5px;padding: 12px 15px;background-color: transparent !important;background-image: none !important;—tve-applied-background-image: none !important;—background-image: none !important;}[data-css=“tve-u-1886173d6fe”] .tcb-button-link span{color: rgb(255,255,255);—tcb-applied-color: #fff;}[data-css=“tve-u-1886173d6fe”]{—tcb-local-color-62516: rgb(77,20,20) !important;margin: 0px !important;}:not(#tve) [data-css=“tve-u-1886173d6fe”] .tcb-button-link{line-height: 1.2em;font-size: 18px;}}

Click Here Now

[thrive_posts_gallery category=’70’ title=”Geeks Gifts” no_posts=”6″ filter=”recent”]
[xyz-ihs snippet=”CodeProject”]

Related Articles

GeeksGifts

Geeks Gifts: Surprise a Girl with Cats or Flowers Wallpaper Changing App

As I previously mentioned I like to make surprises to the people I value. You can find some of my unique geeks' gifts ideas in my- Geeks Gifts Series. In this a

Geeks Gifts: Surprise a Girl with Cats or Flowers Wallpaper Changing App
Anton Angelov

About the author

Anton Angelov is Managing Director, Co-Founder, and Chief Test Automation Architect at Automate The Planet — a boutique consulting firm specializing in AI-augmented test automation strategy, implementation, and enablement. He is the creator of BELLATRIX, a cross-platform framework for web, mobile, desktop, and API testing, and the author of 8 bestselling books on test automation. A speaker at 60+ international conferences and researcher in AI-driven testing and LLM-based automation, he has been recognized as QA of the Decade and Webit Changemaker 2025.