Facebook

Animated Donut : C program


Hi,

Just like my previous post in which India's map was generated using an obfuscated C code, here an animated donut will be generated, again using C code.

Note : This is not my work. All credit to original author (link at the bottom).


This donut program has two versions.

Version 1:

(To avoid any error due to formating and special characters, I am including screen-shots of the code. Actual code can be found on the Original Author's page. Copy the code and save it in a file donut.c and compile using the command given below.

 


Execute this Code using the command -
gcc -o donut donut.c -lm
Ignore any warnings. Now run it using command -
./donut

Output should look like below image:







Version 2:

This is much more impressive.




Save and compile this code again using the same command and run it.

Credit - Andy Sloane 
Follow this link to know the mathematics behind this animation.

10 comments:

  1. I have read your blog.It is really interesting to read.Keep sharing more like this.
    Regards,
    C++ Training in Chennai | C++ programming course

    ReplyDelete
  2. Correctly I'm done by +2 I want to move my graduation degree B.Tech(IT). I'm not Basic knowledge programming. First I start code for C, C++ program I read this post I was really good.Thank you so much.
    Hadoop Training in Chennai | Hadoop Training Course in Chennai

    ReplyDelete