[Lugge] Programming C++ also when you are in love!

  • From: Roberto A.Foglietta <fogliettar@xxxxxxxxxxxxxxxxxx>
  • To: LUGGE <lugge@xxxxxxxxxxxxx>
  • Date: Fri, 10 May 2002 18:21:35 +0200

// IO is always useful
#include <iostream> 

// Special class header
#include <topamng>

// Just in time!
#define AS_SOON_AS_POSSIBLE (EXACTLY | NOW)
#define LATER random()%MAX_YOU_CAN_WAIT*HOUR
#define NEVER MAX_YOU_CAN_WAIT*HOUR+1

// Some object
string reply;
donna::tipa topa;

void main() 
{
 // Here, it's work fine the method tipa::topa.meet(her) too 
 // but managing random events may be more complicated 
 tipa::topa.call(her); 

 // Trying to express your desire it's the first step of happyness
 try {  
        reply = tipa::topa.would(see, me);
 }
 // Be ready to manage exceptions  
 catch(){ 
        if( donna::topa.cry() )  {
                // That's 'amore'!
                donna::topa.marry(me);
                // Game over!
                quit(0);
        } else {
                // that's a big mess or a big husband not so happy of your 
interest!
                cout << "\nIt was a pleasure keep a two of spades from you, 
thank you very much 'n' good bye\n"
                exit(-2);
        }
 }

 // Standard procedure to reach the satisfaction  
 if( strcasecmp(reply.c_str(), "NO") 
        // NO is NO but some NO are less NO than others
        tipa::topa.call(LATER); 
 else if( strcasecmp(reply.c_str(), "SI") )
        // Sometimes it could happen: sleep 'n' dream!
        cout << "\nYabadabadooooooooo\n"
        tipa::topa.updown(AS_SOON_AS_POSSIBLE); 
 else
        // The most frequent case in natural enviroment
        if( donna::topa.guess(reply) == RIGHT )
                tipa::topa.updown(LATER); 
        else
                tipa::topa.updown(NEVER); 

 /* In any case */
 pub.drink(beer);

 /* It's quite impossible to quit with ZERO problems */
 exit(1);
}
 
 P.S.: il programma e` ovviamente sotto GPL e si accettano correzioni 
all'inglese e al C++, inoltre le classi sono ancora da scrivere. Mi preoccupano 
soprattutto le variabili di tipo privato della classe donna (oggetto assai 
misterioso), la classe topa invece ha davvero pochi metodi ma si combinano una 
favola!

 Ciao,
-- 
   ,__    ,_     ,___   .-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
   ||_)   ||\    ||_   /            GEA Automotive S.R.L.             |
   || \   ||¯\   ||¯        Software Research & Develop Division      |
   ¯¯  ¯° ¯¯  ¯° ¯¯  °   tel.: +39 010 65966917                       |  
   Roberto A. Foglietta  com.: mailto:fogliettar@xxxxxxxxxxxxxxxxxx   |
 \ Linux & SW Architect  per.: http://digilander.iol.it/robang        |
  `-----------------------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-'

<========----------
 Prima di scrivere in m-list per favore leggi il regolamento
 http://lugge.ziobudda.net/soci/manifesto.htm#list

 Archivio delle e-mail postate in lista
 //www.freelists.org/archives/lugge/

----------========>
 Incontri in sede: martedì 15:00-18:00 e sabato 9:30-12.30
 

Other related posts: