Giter VIP home page Giter VIP logo

heart-curve-cplusplus's Introduction

##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:

heart shape equation 1

The main.cpp draws a heart shape like this:

main.cpp

The main2.cpp draws a heart shape like this:

main2.cpp

The main3.cpp is based on another different heart curve equation. The equation is as follows:

heart shape equation 2

And the result of main3.cpp is like this:

main3.cpp

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:

main4.cpp

main5.cpp

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

个人公众号:是不是很酷:)

QRCode

heart-curve-cplusplus's People

Contributors

liuyubobobo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.