• Здраво и добредојдовте на форумот на IT.mk.

    Доколку сеуште не сте дел од најголемата заедница на ИТ професионалци и ентузијасти во Македонија, можете бесплатно да се - процесот нема да ви одземе повеќе од 2-3 минути, а за полесна регистрација овозможивме и регистрирање со Facebook и Steam.

Funny programming

  • Ја почнал/а темата
  • #1

Fiasco

Gaining Experience
2 март 2008
3,036
203
404
www.igorjanevski.com
if x then
#if condition is true
[do something]
end if.
:LOL::LOL:

ova me iznasmea:

int addandsubtract (int a, int b)
{
return (a + b);
return (b - a);
}
 
  • Ја почнал/а темата
  • #2

Fiasco

Gaining Experience
2 март 2008
3,036
203
404
www.igorjanevski.com
adjust_alpha()
{
alpha = gamma + offset * 3;
}

adjust_beta()
{
beta = gamma + offset * 3;
}

--------------------------------------

if (value == 0)
return value;
else
return 0; :LOL:

-------------------------

if (a)
{
/* do something */
return x;
}
else if (!a)
{
/* do something else */
return y;
}
else
{
/* do something entirely different */
return z;
}
 

Alexandar

Gaining Experience
21 мај 2007
2,514
90
За сите оние кои во школо ги учат дека за две променливи да си ги сменат вредностите треба уште една, т.е.

temp:=a;
a:=b;
b:=temp;

Еве како да бидете попаметни од професорот:

a:=a+b;
b:=a-b;
a:=a-b;

Резултат: помалку користена меморија, т.е. подобар алгоритам :)
 
  • Ја почнал/а темата
  • #13

Fiasco

Gaining Experience
2 март 2008
3,036
203
404
www.igorjanevski.com
Код:
struct female_professionals
{
double styles;
short skirts;
long time_to_understand_problems;

float mind;
void knowledge;
char non_co-operative;
}

struct married_females
{
double weight;
short tempered;
long gossip;
float hopes;
void word;
char unstable;
}

struct engaged_females
{
double time_on_phone;
short attention_on_work;
long boast;
float on_cloud_nine;
void understanding;
char edgy;
}

struct newly_married_females
{
double dinner_invitation;
short time_at_work;
long lunch_break;
void bank_balance;
char hen_pecked;
}

struct husband_wife_professionals
{
double income;
short tempered;
long time_no_see_each_other;
void love_life;
char money_making;
}

struct beautiful_city_girl
{
double boyfriends;
short affairs;
long stories;
void greymatter;
char flirt;
}

struct old_lady
{
double chin;
short memory;
long sighs ;
void attention_from_men;
char chatterbox;
}
 

Metuzalem

Epic
28 ноември 2010
6,573
11,903
1000 Скопје
Metuzalem's setup  
Processor & Cooler
i7-2600K @4,6 GHz, Noctua NH-D14
Motherboard
ASUS P8Z68-V/GEN3
Storage
Samsung 840 Pro 256 Gb SSD, Samsung Spinpoint F3 1 Tb
PSU
CM 600W Silent Pro Gold
RAM
Kingston @1866
Video card
Radeon HD 7750
Case
HAF 912 Plus
Mouse
ASUS ROG GX950
Keyboard
Filco Majestouch-2, Logitech G710+
Audio
Realtek ALC892
Monitor
Viewsonic VX2753MH-LED
OS
WinServer2003, Win7 x64
Се надевам не е предолго...

Код:
Subject: *** TOP SECRET MICROSOFT CODE ***
Project:  Version - Windows 95

Microsoft marketing strategy (MARKET.EXE):

#include <nonsense.h>
#include <lies.h>
#include <spyware.h> /* Microsoft Network Connectivity library */
#include <process.h> /* For the court of law */

#define say(x) lie(x)
#define computeruser ALL_WANT_TO_BUY_OUR_BUGWARE
#define next_year soon
#define the_product_is_ready_to_ship   another_beta_version

void main()
{
  if (latest_window_version>one_month_old)
  {
    if (there_are_still_bugs)
      market(bugfix);
    if (sales_drop_below_certain_point)
      raise(RUMOURS_ABOUT_A_NEW_BUGLESS_VERSION);
  }
  while(everyone_chats_about_new_version)
  {
    make_false_promise(it_will_be_multitasking); /* Standard Call, in
                                                    lie.h */
    if (rumours_grow_wilder)
      make_false_promise(it_will_be_plug_n_play);
    if (rumours_grow_even_wilder)
    {
      market_time=ripe;
      say("It will be ready in one month);
      order(programmers, stop_fixing_bugs_in_old_version);
      order(programmers, start_brainstorm_about_new_version);
      order(marketingstaff, permission_to_spread_nonsense);
      vapourware=TRUE;
      break;
     }
  }
  switch (nasty_questions_of_the_worldpress)
  {
     case WHEN_WILL_IT_BE_READY:
       say("It will be ready in", today+30_days," we're just testing");
       break;
    case WILL_THIS_PLUG_AND_PLAY_THING_WORK:
       say("Yes it will work");
       ask(programmers, why_does_it_not_work);
       pretend(there_is_no_problem);
       break;
     case WHAT_ARE_MINIMAL_HARDWARE_REQUIREMENTS:
       say("It will run on a 8086 with lightning speed due to"
           " the 32 bits architecture");
       inform(INTEL, "Pentium sales will rise skyhigh");
       inform(SAMSUNG, "Start a new memorychip plant"
              "'cos all those customers will need at least 32 megs");
       inform(QUANTUM, "Thanks to our fatware your sales will triple");
       get_big_bonus(INTEL, SAMSUNG, QUANTUM);
       break;
     case DOES_MICROSOFT_GET_TOO_MUCH_INFLUENCE:
       say("Oh no, we are just here to make a better world for
            everyone");
       register(journalist, Big_Bill_Book);
       when(time_is_ripe)
       {
         arrest(journalist);
         brainwash(journalist);
         when(journalist_says_windows95_is_bugfree)
         {
           order(journalist, "write a nice objective article");
           release (journalist);
         }
       }
       break;
   }
   while (vapourware)
   {
     introduction_date++; /* Delay */
     if (no_one_believes_anymore_there_will_be_a_release)
       break;
     say("It will be ready in",today+ONE_MONTH);
  }
  release(beta_version)
  while (everyone_is_dumb_enough_to_buy_our_bugware)
  {
    bills_bank_account += 150*megabucks;
    release(new_and_even_better_beta_version);
    introduce(more_memory_requirements);
    if (customers_report_installation_problems)
    {
      say("that is a hardware problem, not a software problem");
      if (smart_customer_says_but_you_promised_plug_and_play)
      {
        ignore(customer);
        order(microsoft_intelligence_agency, "Keep an eye on this
                                              bastard");
      }
    }
    if ( bills_bank_account>skyhigh && marriage>two_years )
    {
      divorce(woman_that_was_beatifull_when_I_married_her);
      wave(dollars, at_lusty_chicks);
      marry(young_blond_virgin_with_big_boobies);
      devirginize(young_blond_virgin_with_big_boobies);
      if (boobies_start_to_hang)

        dump(young_blond_virgin_with_big_boobies);
    }
    if (there_is_another_company)
    {
      steal(their_ideas);
      accuse(compagny, stealing_our_ideas);
      hire(a_lot_of_lawyers); /* in process.h */
      wait(until_other_company_cannot_afford_another_lawsuit);
      buy_out(other_company);
    }
  }
  /* Now everyone realizes that we sell bugware and they are all angry at
     us */
  order(plastic_surgeon, make_bill_look_like_poor_bastard);
  buy(nice_little_island); hire(harem);
  laugh_at(everyone,
for_having_the_patience_year_after_year_for_another_unfinished_version);
}


void bugfix(void)
{
  charge (a_lot_of_money)
  if (customer_says_he_does_not_want_to_pay_for_bugfix)
    say("It is not a bugfix but a new version");
  if (still_complaints)
  {
    ignore(customer);
    register(customer, big_Bill_book);
    /* We'll get him when everyone uses Billware!!*/
  }
}
 

Petkovsky

Intern
7 декември 2009
323
31
Код:
public int negacijaNaBroj(int n) {
    int i; 
    while (true) { 
        i = Math.random() * MAX_INT; 
        if (i + n==0)  
        return i; 
    }
}
Или објектниот модел
Код:
NumberOperationsFactory factory = AbstractOperationsFactory.newNumberOperationsFactory(); 
IntegerOperations operations = factory.newIntegerOperations(); 
return n - operations.multiply(new Integer(n), new Integer(2)).intValue();
 

B^nDIT

Gaining Experience
6 февруари 2010
1,124
311
Го стави во notepad сејв .exe и принтерот почна да ми принта празни листови :zbunet3:

НЕ САКА ДА ПРЕСТАНЕ ЌЕ УБИАМ НЕКОЈ!!!:guns3:
Оти не се убиеш самиот? Ти си го отворил тоа...

И почни да го пишуваш твоето последно писмо на Word... Нема да принта празни листови , ќе го принта писмото...
 

NetworX

Intern
3 мај 2009
959
46
Барем да помогнеше...:ha:

P.S Го направив некако излгеа му помина меракот да принта:muahaha:
 

Нови мислења

Последни Теми

Статистика

Теми
43,584
Мислења
824,006
Членови
28,082
Најнов член
Welendar
На врв Дно