(For programmers’ matters bookmark it)
Source: Open Source China
With the popularity of the sci-fi movie “The Wandering Earth” during the Spring Festival, more and more netizens have developed a strong interest in this film. Especially among developers, the segment of “Twelve Sounds of Spring Festival” in the movie will surely leave a lasting impression on every developer who has watched it.
Recently, a passionate developer wrote a piece of C language source code for “Twelve Sounds of Spring Festival” and uploaded it to GitHub, attracting widespread attention from netizens.
In the movie, the “Twelve Sounds of Spring Festival” program was written by engineer Li Yiyi, which ignites the flames from the Pioneer Space Station by spraying the ion beam from the engine onto the atmosphere of Jupiter, 65,000 kilometers away from Earth, thus achieving the program to explode Jupiter.
Without further ado, let’s look at the code : )
// File: twelve_biubiu.c
// Permission: CN-2082-2
// Author: Li.YiYi
// Dept: PE-362, UG
// Origin: TI-352132
// Twelve Sounds of Spring Festival biu biu biu!
#env "planet_engine"
int init() {
set_engine_number_mask(ENGINE_ALL);
set_fuel_level(FUEL_FULL);
// Allowable error within 10 seconds
if (unix_time() < make_unix_time(2082, 1, 28, 23, 59, 60-10)) return ERR_ENGIN_ENV;
return engine_check_init(); // after compile and before real run
}
int main() {
set_curve(CURVE_NATURAL); // Natural curve consumes the least fuel
for (int i :range(0, 12, 1)) {
engine_start();
wait_engine(ENGINE_STATE_CHAGNE);
sleep(2000);
engin_stop();
wait_engine(ENGINE_STATE_CHAGNE);
sleep(4000); // This duration sounds more like a heartbeat in the simulator
}
return 0;
}
int final() {
engine_ensure_shutdown();
}
The author named the C language code file: twelve_biubiu.c. Well, you are serious about this. More importantly, there are quite a few serious programmers who have raised issues in the GitHub repository for the Twelve Sounds of Spring Festival. Hmm, it seems that everyone is taking this very seriously.
Yes, to run this program, you also need the additional “planet engine” runtime environment and the corresponding header files. Interested netizens can access the original address to obtain the source code:
https://github.com/picasso250/spring12
Or, submit a PR to improve it?
Recommended Reading
(Click the title to read)
Serious bug! Luo Yonghao’s chat treasure can be exchanged for millions in cash
Hard to distinguish between true and false! They are all AI-generated
Too many swear words in the source code, OpenJDK developers couldn’t stand it
Follow “Programmers’ Matters” and bookmark it, so you won’t miss out on industry news
If you like it, just give it a “like”~