Young men and women friends, today is a very important day: 520, do not know from what time began to rise, although a lot of single people saw this few days feel annoying, but there are a large part of the good chance of singles are waiting for tomorrow, after all, the right place, right time, must cherish such a good day.
There are many ways to express your love, but you can’t afford to send flowers and gifts. As a programmer, I don’t understand the popular bubble machine, pig, gravity sensor car and other toys, and I don’t want to let my friends show off by sending money. After all, the truth is important, and money is material. I can give you a single fans do may be only do share some code on the computer to knock on a few lines of code, let her in a depressed on Monday to get a big surprise, very simple, a look at will, if it doesn’t matter now, with less than, collection first, anyway, so a lot of festivals, and use it every time you can find in the future.
From simple to complex, let’s start with five.
1. Browser tabs
This one doesn’t use any code, but it’s pretty simple. Get to the office early, or when your date isn’t looking, install Chrome on her computer, set it to the default browser, and turn on syncing. Then choose an appropriate time to log in to your account on your computer and add what you want to say in the TAB, such as the following:
The tag is then automatically synchronized to the object’s browser.
2, two keys combined into I LOVE U
This is a simple function that takes advantage of the web search function, and copies this text on a web page,
Then CRTRL +f, type 9 in the input box and press Enter to see what it looks like:
3. Python profession code
The code of the heart shape and the circular ellipse is similar. Both are curves formed by points on X and Y. An expression is determined, followed by two for loops (for Y in range; For x in range), and then row by column at the beginning.
It’s a little monotonous, of course, but we can do it this way, get it moving, like this
Print (‘ \ n ‘. Join ([(‘ Love ‘ ‘ ‘. Join ([[(x-y) % len (‘ Love ‘)] the if ((0.05) x * * * 2 + 0.1) (y * * * 2-1) 3 – (0.05) x * * * * * 2 * * * 3 (y * 0.1) < = 0 the else ‘ ‘) for x in range(-30, 30)]) for y in range(30, -30, -1)]))
Of course, can also replace the expression, this code will not put, need to directly with me on the line.
4. Something cool
C language interpretation of love – for TA to write down the heart, generated procedures to TA, TA point open procedures to understand you.
This starts with the name of the object, and then comes the most important part of the fireworks. To make the fireworks more realistic, we need to add gravity effects and air resistance effects, as shown in the source code below
If you need the source code to leave the post can be.
5. Make fun of it
This one fits a good relationship. Look how it works
Source code direct
Finally put a code expression diagram, the same code can not be put out, but can be directly used.
This code must be very simple in the eyes of programmer friends, and programmers generally do not use, because their objects do not need to declare, a NEW one can be. Novice can slowly learn, just have a sense of achievement, will be very surprised oh.
** For those who are learning programming or programmers who want to get promoted at work, if you want to improve your programming ability, help you improve your level! ** I may be able to help you here ~
C language C++ programming learning exchange circle, **QQ group [765803539] ** wechat public number: C language programming learning base
Share (source code, project actual combat video, project notes, basic introduction tutorial)
Welcome to change careers and learn programming partners, use more information to learn and grow faster than their own thinking oh!
Programming learning video sharing: