Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all, I'm a student and have to do a couple of exercises, but I'm stuck on this one.

I have to write a program that print a figure in the shape of a heart by using the sign "o". But I have no idea how to do it.

What I have tried:

I have tried google and MSDN, but could not find a solution.
Posted
Updated 3-Jul-17 13:57pm

1 solution

Quote:
How do I use char to draw shapes in a console application

In practice, in a console app, all shapes are bitmaps and use at least 2 chars to show shapes.
For any shape, you have to encode it, and there is basically 2 options:
-You can use mathematical properties and you can encode the shape in code specialized for this shape. square, rectangle, triangle, diamond ...
-You can't use mathematical properties and you have to encode the shape as data and write some code to display the shape. Any shape that don't fit in first category.
This is your homework, you have to write the code.

As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.

The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^]
That's not the same thing as "have a quick google and give up if I can't find exactly the right code".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900