Riccardo's profileRiccardo Tempesta - Wind...PhotosBlogListsMore Tools Help

Blog


    December 07

    Il primo operatore disponibile... ne rimarrà solo uno!

    Ragazzi aiuto!! Sto ancora combattaendo con Vodafone, ma credo di aver capito la logica del 190... dopo 40 (diconsi quaranta) minuti di attesa ho distillato un algoritmo.

    Solo per informatici o affini:

    1. On (customer_calls)
    2. {
    3.     randomize();
    4.     while (rand(0, 10) != 1)
    5.     {
    6.         play_music();
    7.         say_stupid_things();
    8.     }
    9.     while (true)
    10.     {
    11.         if (is_luky(customer)) break;
    12.         call(please_hold_on);
    13.     }
    14.     if (!is_luky(customer)) return -1;
    15.     if (wants_to_pay(customer))
    16.     {
    17.         be_competent();
    18.         be_polite();
    19.         can_answer_questions(true);
    20.         return 0;
    21.     }
    22.     else if (wants_to_complain(customer))
    23.     {
    24.         be_an_ass_hole();
    25.         can_answer_questions(false);
    26.         if (!is_luky(customer))
    27.         {
    28.             hang_up();
    29.             return -1;
    30.         }
    31.         return 0;
    32.     }
    33.     else
    34.     {
    35.         say_bullshit(rand(0, 20));
    36.         return 0;
    37.     }
    38.     return 1;
    39. }