Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2007-10-10 07:24:24

mikau
Member
Registered: 2005-08-22
Posts: 1,504

coding jokes

ever realized the unique types of jokes you can make just using segments of code?

today in class we were asked to buddy up with a classmate and provide a coded example of loop invarients. Me and my classmate submitted this as our example:

while (living)
{
	angst++;
	ddf_self_rightousness=angst*2;
	itchiness = angst - 1;

	if (itchiness > 500)
	{
		cout<<"Too many bug bites!"<<endl;
		living = false;
	}
}

// Loop Invarient:  Itchiness is always less than angst.

later on, we were told to buddy up for another in class assignment. This time the teacher pointed to the two of us as and said "I want you two to work seperately"

Last edited by mikau (2007-10-10 07:26:08)


A logarithm is just a misspelled algorithm.

Offline

#2 2007-10-10 08:48:44

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,711

Re: coding jokes

I would have kept you together ... to see what else happens!


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#3 2007-10-10 09:02:26

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

Re: coding jokes

Have you ever seen windows source code?

#include "win31.h"
#include "win95.h"
#include "win98.h"
#include "workst~1.h"
#include "evenmore.h"
#include "oldstuff.h"
#include "billrulz.h"
#include "monopoly.h"
#include "backdoor.h"
#define INSTALL = HARD

char make_prog_look_big(16000000);
void main()
{
  while(!CRASHED)
  {
    display_copyright_message();
    display_bill_rules_message();
    do_nothing_loop();

    if (first_time_installation)
      {
      make_100_megabyte_swapfile();
      do_nothing_loop();
      totally_screw_up_HPFS_file_system();
      search_and_destroy_the_rest_of-OS2();
      make_futile_attempt_to_damage_Linux();
      disable_Netscape();
      disable_RealPlayer();
      disable_Lotus_Products();
      hang_system();
      } //if
    write_something(anything);
    display_copyright_message();
    do_nothing_loop();
    do_some_stuff();

    if (still_not_crashed)
    {
    display_copyright_message();
    do_nothing_loop();
    basically_run_windows_31();
    do_nothing_loop();
    } // if
  } //while

  if (detect_cache())
    disable_cache();

  if (fast_cpu())
    {
    set_wait_states(lots);
    set_mouse(speed,very_slow);
    set_mouse(action,jumpy);
    set_mouse(reaction,sometimes);
    } //if

  /* printf("Welcome to Windows 3.1");    */
  /* printf("Welcome to Windows 3.11");   */
  /* printf("Welcome to Windows 95");     */
  /* printf("Welcome to Windows NT 3.0"); */
  /* printf("Welcome to Windows 98");     */
  /* printf("Welcome to Windows NT 4.0"); */
  printf("Welcome to Windows 2000");

  if (system_ok())
    crash(to_dos_prompt)
  else
    system_memory = open("a:\swp0001.swp",O_CREATE);

  while(something)
    {
    sleep(5);
    get_user_input();
    sleep(5);
    act_on_user_input();
    sleep(5);
    } // while
  create_general_protection_fault();

} // main

"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."

Offline

#4 2007-10-10 09:06:46

mikau
Member
Registered: 2005-08-22
Posts: 1,504

Re: coding jokes

wahaha! wait.... was that found in professional windows code?


A logarithm is just a misspelled algorithm.

Offline

#5 2007-10-11 01:28:34

Laterally Speaking
Real Member
Registered: 2007-05-21
Posts: 356

Re: coding jokes

Of course. If I had time, I might point out that there is a bit more to it, and it' better hidden than that, but that's basically it.


"Knowledge is directly proportional to the amount of equipment ruined."
"This woman painted a picture of me; she was clearly a psychopath"

Offline

#6 2007-10-11 03:27:21

mikau
Member
Registered: 2005-08-22
Posts: 1,504

Re: coding jokes

here's one.

while (tvSize < desiredSize)
{
   tvSize += 13;
   desiredSize = 2*tvSize;
}

A logarithm is just a misspelled algorithm.

Offline

#7 2007-10-17 04:02:25

lightning
Real Member
Registered: 2007-02-26
Posts: 2,060

Re: coding jokes

hehehehe mikaus funny do you have any more??? EVEN FUNNYER??? That would be so sweet WOOHOO Um still waiting......OH COME ON tongue


Zappzter - New IM app! Unsure of which room to join? "ZNU" is made to help new users. c:

Offline

#8 2007-10-17 04:48:07

bossk171
Member
Registered: 2007-07-16
Posts: 305

Re: coding jokes

These are fun, it takes a certain breed of humor to appreciate them, and I do.

Thus far the tvSize < desiredSize is the best.


There are 10 types of people in the world, those who understand binary, those who don't, and those who can use induction.

Offline

#9 2007-10-17 05:00:34

lightning
Real Member
Registered: 2007-02-26
Posts: 2,060

Re: coding jokes

Laterally Speaking: Of course. If I had time, I might point out that there is a bit more to it, and it' better hidden than that, but that's basically it.

why don't you say something then when you come back on..........EDIT is the word my friend


Zappzter - New IM app! Unsure of which room to join? "ZNU" is made to help new users. c:

Offline

Board footer

Powered by FluxBB