##Happy Valentine's Day in 2017
In this repo, I use C++ to draw a heart shape in the command line console! The code is easy, short and fantastic:)
I've blogged a small article about these codes in imooc.com, one of the toppest MOOC websites in China. You could view this blog here.
files main.cpp and main2.cpp are based on the heart curve equation as follows:
The main.cpp draws a heart shape like this:
The main2.cpp draws a heart shape like this:
The main3.cpp is based on another different heart curve equation. The equation is as follows:
And the result of main3.cpp is like this:
Inspired by @甲铁城的卡巴司机 in my class group, I added two more examples - main4.cpp and main5.cpp. Both of them fill the heart shape with characters, using above two heart shape equations. The effects look like as follows:
Please enjoy!
If you have more ideas about how to draw a heart shape curve or any other beautiful shape curves, please contact me. I'm looking forward to discussing the beauty of mathematics and computer science with you!
个人网站:liuyubobobo.com
电子邮件:[email protected]
微博: 刘宇波bobo http://weibo.com/liuyubobobo
知乎: 刘宇波 http://www.zhihu.com/people/liuyubobobo
知乎专栏:是不是很酷 https://zhuanlan.zhihu.com/liuyubobobo
个人公众号:是不是很酷:)