Skip to main content
23-Emerald V
September 11, 2021
Question

ASCII Art - Obfuscated C Doughnut

  • September 11, 2021
  • 2 replies
  • 4778 views

My younger son pointed out the following YouTube video to me: 

 

It shows an ASCII Art toroid (doughnut/donut) written in C, with the code nicely obfuscated to look like a doughnut.

 

I couldn't replicate the obfuscation in Mathcad (although my code is usually obfuscated at the best of times), but I did think that I might try to produce the "animation".   If I had Mathcad 15, I could have used the animation facility, but as I'm using Prime 7.0, I constructed a vector of successive frames, instead.

 

Stuart

 

I would have presented a more generalized version (eg, user-defined: row size, column size, and perspective depth), but I only have a few more days of the 30-day Trial left, and far too many other worksheets under development to spend upon a relatively undemanding task.

 

 

2 replies

23-Emerald IV
September 16, 2021

Something like the attached?

Doughnut.gif

 

Luc

23-Emerald V
September 16, 2021

@LucMeekes wrote:

Something like the attached?


Indeed - including perspective, replacing the equations used in the C code.

 

OOIC, did you use animation or drive the 3D Plot Component directly?

 

Stuart

23-Emerald IV
September 17, 2021

You see all there is to see regarding the Mathcad 'code': FRAME was not used. I plotted the doughnut, turned it's view to a nice position and gave it a modest swing (which is the hardest part). Then I grabbed the screen for the duration of more than a single turn, converted the footage to an animated gif and cut pictures until a single turn of pictures remained.

Luc

23-Emerald V
September 17, 2021

That's strange ... I can't see my Mathcad worksheet as an attachment.

 

Just in case, I'll add it to this post.

 

Stuart