Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shapes in C++ Programs [duplicate]

Tags:

c++

If I recall correctly, I saw some ungodly C++ library that let you type ASCII-art shapes in C++ programs and treat them as objects. Something like this:

int area = someFreakyClass(o-----o
                           |     |
                           o-----o).area();

What was this library called?

like image 934
Maxpm Avatar asked Apr 05 '11 15:04

Maxpm


3 Answers

Analog Literals by Eelis.

like image 110
Lightness Races in Orbit Avatar answered Nov 08 '22 08:11

Lightness Races in Orbit


Improved version of Analog Literals:

Tweaking Analog Literals (C++ humor)

like image 39
Nawaz Avatar answered Nov 08 '22 08:11

Nawaz


Something like this:

 int area = someFreakyClass(_________________________________________________
                    /|     |                                                 |
                    ||     |                                                 |
               .----|-----,|                                                 |
               ||  ||   ==||                                                 |
          .-----'--'|   ==||                                                 |
          |)-      ~|     ||_________________________________________________|
          | ___     |     |____...==..._  >\______________________________|
     [_/.-.\"--"-------- //.-.  .-.\\/   |/            \\ .-.  .-. //
       ( o )`==="""""""""`( o )( o )     o              `( o )( o )`
        '-'                '-'  '-'                       '-'  '-').area();
like image 3
Scherbius.com Avatar answered Nov 08 '22 06:11

Scherbius.com