Omnimaga

General Discussion => Other Discussions => Humour and Jokes => Topic started by: Matrefeytontias on November 10, 2014, 02:30:36 pm

Title: Important life algorithms
Post by: Matrefeytontias on November 10, 2014, 02:30:36 pm
Today I learnt something : life is made of algorithms. I discovered one today, being a student in my own appartment :

Code: [Select]
while(oreo)
    oreo--;

Did you discover things like this ?
Title: Re: Important life algorithms
Post by: aeTIos on November 10, 2014, 04:54:59 pm
Oh yes, most definitely.
Code: [Select]
while(time_until_test_minutes > 240)
       procrastinate;
freak_out();
Title: Re: Important life algorithms
Post by: bb010g on November 10, 2014, 10:57:09 pm
Oh yes, most definitely.
Code: [Select]
while(time_until_test_minutes > 240)
       procrastinate;
freak_out();
Hey! That's my IP! :P
Title: Re: Important life algorithms
Post by: DJ Omnimaga on November 11, 2014, 02:27:21 am
Today I learnt something : life is made of algorithms. I discovered one today, being a student in my own appartment :

Code: [Select]
while(oreo)
    oreo--;

Did you discover things like this ?

Assuming you mean Oreo biscuits, I think the following would be closer to reality :P


Code: [Select]
oreoPurchase := 3
oreoEaten := 0
hospital :=0
WHILE 1 DO
oreoEaten = oreoEaten + 1;
oreoPurchase = oreoPurchase ^ 2;
IF oreoEaten > 256 THEN
hospital := 1;
END;
END;
Title: Re: Important life algorithms
Post by: willrandship on November 11, 2014, 02:49:19 am
Code: [Select]
while(1):
 if(time()<0600): sleep(0400);
 for task in todo:
  if task.due < time(): panic()
  elif task.due - time() < 200: panicdo(task)
  else: sleep(0200)
Title: Re: Important life algorithms
Post by: aeTIos on November 11, 2014, 04:29:25 am
Today I learnt something : life is made of algorithms. I discovered one today, being a student in my own appartment :

Code: [Select]
while(oreo)
    oreo--;

Did you discover things like this ?

Assuming you mean Oreo biscuits, I think the following would be closer to reality :P


Code: [Select]
oreoPurchase := 3
oreoEaten := 0
hospital :=0
WHILE 1 DO
oreoEaten = oreoEaten + 1;
oreoPurchase = oreoPurchase ^ 2;
IF oreoEaten > 256 THEN
hospital := 1;
END;
END;
Well... that escalated quickly ^^'
Title: Re: Important life algorithms
Post by: Streetwalrus on November 12, 2014, 01:07:32 am
Oh yes, most definitely.
Code: [Select]
while(time_until_test_minutes)
       procrastinate;
go_to_test_unprepared_but_perfectly_cool();
Ftfy. :P
Title: Re: Important life algorithms
Post by: DJ Omnimaga on November 12, 2014, 01:40:40 am
Today I learnt something : life is made of algorithms. I discovered one today, being a student in my own appartment :

Code: [Select]
while(oreo)
    oreo--;

Did you discover things like this ?

Assuming you mean Oreo biscuits, I think the following would be closer to reality :P


Code: [Select]
oreoPurchase := 3
oreoEaten := 0
hospital :=0
WHILE 1 DO
oreoEaten = oreoEaten + 1;
oreoPurchase = oreoPurchase ^ 2;
IF oreoEaten > 256 THEN
hospital := 1;
END;
END;
Well... that escalated quickly ^^'
And in HP PPL it escalates instantly. :P The speed at which ClassPad II Basic gets executed might be closer to reality.
Title: Re: Important life algorithms
Post by: Streetwalrus on November 12, 2014, 02:19:57 pm
And in HP PPL it escalates instantly. :P The speed at which ClassPad II Basic gets executed might be closer to reality.
Lol at that one. :P
Title: Re: Important life algorithms
Post by: bb010g on November 19, 2014, 08:55:35 pm
Today I learnt something : life is made of algorithms. I discovered one today, being a student in my own appartment :

Code: [Select]
while(oreo)
    oreo--;

Did you discover things like this ?

Assuming you mean Oreo biscuits, I think the following would be closer to reality :P


Code: [Select]
oreoPurchase := 3
oreoEaten := 0
hospital :=0
WHILE 1 DO
oreoEaten = oreoEaten + 1;
oreoPurchase = oreoPurchase ^ 2;
IF oreoEaten > 256 THEN
hospital := 1;
END;
END;
Y U NO USE IFTE OR MAKELIST?!?!?! OPTAMAIZE!
Code: [Select]
oreoPurchase := 3
oreoEaten := 0
hospital :=0
BEGIN f() oreoPurchase = oreoPurchase ^ 2; oreoEaten := oreoEaten+1; END;
MAKELIST(f(), O, 0, 255);
hospital := 1;
END;
Title: Re: Important life algorithms
Post by: Sorunome on November 20, 2014, 12:42:28 am
while(sorunome.isAwake()){
        sorunome.beTired()
}
Title: Re: Important life algorithms
Post by: Streetwalrus on November 20, 2014, 05:48:50 am
Code: [Select]
#include "streetwalrus.h"
#include <life.h>
#include <time.h>

int main(void)
{
    while (streetwalrus_alive)
    {
        day_spend(geeky_stuffs);
        sleep(INSANELY_LATE_HOUR);
    }

    // Hopefully we don't reach this point anytime soon
    return streetwalrus_age;
}
Title: Re: Important life algorithms
Post by: ordelore on November 20, 2014, 05:28:40 pm
Code: [Select]
Lbl 1
Sleep
Goto 1
Code: [Select]
While it's the hour before school starts
Do homework
End
Title: Re: Important life algorithms
Post by: pimathbrainiac on November 20, 2014, 05:30:38 pm
Code: [Select]
while(pimath_is_on_computer)
    checkOmnimaga();
Title: Re: Important life algorithms
Post by: ImZealot on November 20, 2014, 05:33:34 pm
That moment while you really wish you got these jokes, and you kinda do, but you don't cause you can't code, and you wish you knew simple code like this.
Title: Re: Important life algorithms
Post by: Keoni29 on November 20, 2014, 05:37:56 pm
If I cannot code
  Pretend like I can
End pretending
Title: Re: Important life algorithms
Post by: Keoni29 on December 20, 2014, 03:05:05 pm
void warranty()
Title: Re: Important life algorithms
Post by: DJ Omnimaga on December 20, 2014, 04:21:54 pm
This needs to be inside an If storeName != Walmart block :P
Title: Re: Important life algorithms
Post by: Eiyeron on December 21, 2014, 06:56:09 am
Code: (c) [Select]
depression_points = {LIFE, SHYNESS, LIFE_CHOICES, LAZINESS, etc...}; // too many to list them.
while(has_projects_to()) {
    if(has_homework_to_do()) {
        if(has_important_project_to_do())
            program_on_small_project(rand()%num_small_projects());
    }
    else
        depressing_about_(depression_points, rand()%num_depression_points());
}

EDIT  :oh wait that isn't humourous nor a joke... WAit...

Code: (c) [Select]
while(it_wont_work()) {
    if(rand()&1)
        depress_about_it();
    else
        try_to_desesperatly_fix_it();
}

... Damn!
Title: Re: Important life algorithms
Post by: Juju on December 22, 2014, 02:35:21 am
https://www.gnu.org/fun/

'Nuff said.
Title: Re: Important life algorithms
Post by: Keoni29 on December 22, 2014, 04:47:58 am
Those are great :D
Title: Re: Important life algorithms
Post by: bb010g on December 23, 2014, 04:28:26 pm
My favourite from there: https://www.gnu.org/fun/jokes/ed-msg.html
Title: Re: Important life algorithms
Post by: Eiyeron on December 23, 2014, 04:35:25 pm
Code: [Select]
#define if(x) if(rand()%10 && (x))

Happy debugging! :p
Title: Re: Important life algorithms
Post by: bb010g on December 24, 2014, 12:34:22 am
Code: [Select]
while(oreo)
    oreo--;
Looking though this again, you could optimize:
Code: [Select]
while(oreo--);
Title: Re: Important life algorithms
Post by: epic7 on December 24, 2014, 02:28:15 pm
Code: [Select]
while(pimath_is_on_computer)
    checkOmnimaga();

How I decide when to go on omni most of the time :P
Code: [Select]
public void onFacebookMessageReceive(Message m)
{
    if(m.sender.getNickname().equals("pimathbraniac"))
    {
        double num = Math.random();
        if(m.body.contains("omni"))
        {
            if(num < 0.8)
                checkOmnimaga();
        }
        else if(num < 0.2)
            checkOmnimaga();
    }
}
Title: Re: Important life algorithms
Post by: pimathbrainiac on December 24, 2014, 02:33:04 pm
True statement. Except I didn't even mention it today...
Title: Re: Important life algorithms
Post by: epic7 on December 24, 2014, 02:35:07 pm
True statement. Except I didn't even mention it today...

That's where the "else if(num < 0.2)" comes in :P
Title: Re: Important life algorithms
Post by: pimathbrainiac on December 24, 2014, 02:36:17 pm
But the frequency is a lot less than that, Mr. "I am on Chief Delphi all the time and pimath knows it"

Also We messed up with Fantasy FIRST
Title: Re: Important life algorithms
Post by: harold on December 24, 2014, 02:46:48 pm
On a slightly more serious note, the MiniMax algorithm also applies to real life. But in order for it to work, you have to be good at predicting consequences and reactions, and you need an objective function, so it's very hard to ever actually use it.
Title: Re: Important life algorithms
Post by: Keoni29 on December 24, 2014, 05:32:01 pm
Code: [Select]
while(oreo)
    oreo--;
Looking though this again, you could optimize:
Code: [Select]
while(oreo--);
I think the compiler does that for you.

In both cases the outcome is:
while:
branch if oreo is zero: endwhile
oreo --
branch to while
endwhile:
Title: Re: Important life algorithms
Post by: lkj on December 24, 2014, 06:56:34 pm
Code: [Select]
while(oreo)
    oreo--;
Looking though this again, you could optimize:
Code: [Select]
while(oreo--);
I think the compiler does that for you.

In both cases the outcome is:
while:
branch if oreo is zero: endwhile
oreo --
branch to while
endwhile:


If we're talking about C/C++, I'm pretty sure they aren't equivalent: the first version only decrements oreo to 0, the second one to -1.
Title: Re: Important life algorithms
Post by: harold on December 24, 2014, 07:20:13 pm
Most other languages too, but you can fix it:
Code: [Select]
while(--oreo);'
You're in trouble if you start with zero though.
Title: Re: Important life algorithms
Post by: bb010g on December 29, 2014, 01:09:12 am
Most other languages too, but you can fix it:
Code: [Select]
while(--oreo);'
You're in trouble if you start with zero though.
Derp. Thanks for the fix. :)
Title: Re: Important life algorithms
Post by: c4ooo on July 26, 2015, 10:37:22 pm
Today I learnt something : life is made of algorithms. I discovered one today, being a student in my own appartment :

Code: [Select]
while(oreo)
    oreo--;

Did you discover things like this ?
Sorry for necro posting, but i felt like this needed a OOP update and a small reality check:  >:D :P
Code: [Select]
package Matrix.AIs.Matrefeytontias;

public class Matrefeytontias {

    private OreoBox oreoBox;
    public static OreoStore oreoStore;

    public static void main(String... args) {
        oreoStore = new OreoStore();
        Matrefeytontias matrefeytontias = new Matrefeytontias();
        matrefeytontias.live();
    }

    private void live() {
        while (oreoStore.hasOreos()) {
            buyOreos();
            while (oreoBox.hasOreos()) {
                oreoBox.eatOreos();
            }
        }
        //die
    }

    private void buyOreos() {
        oreoBox = oreoStore.buyBox();
    }

    static class OreoStore {

        int boxes;

        OreoStore() {
            boxes = 100;
        }

        OreoBox buyBox() {
            boxes--;
            return new OreoBox();
        }

        boolean hasOreos() {
            return boxes != 0;
        }
    }

    static class OreoBox {

        int numberOfOreos;

        OreoBox() {
            numberOfOreos = 50; //Correct me here please
        }

        void eatOreos() {
            numberOfOreos--;
        }

        boolean hasOreos() {
            return numberOfOreos != 0;
        }
    }
}
Title: Re: Important life algorithms
Post by: Eeems on July 27, 2015, 05:20:07 pm
Hmm, seems like too much work to just eat Oreos.
Title: Re: Important life algorithms
Post by: c4ooo on July 28, 2015, 01:34:15 am
Hmm, seems like too much work to just eat Oreos.
That was sort of the point, to laugh at OOP :P
Also I am somewhat jealous that @Matrefeytontias has an Oreo store inside of him. :P  ;)
However I am a little freaked out that he has an Oreo box inside of him.   O.O  XD
Title: Re: Important life algorithms
Post by: Matrefeytontias on July 28, 2015, 03:10:46 am
Don't stick inadequate things in me please.



What ? Did I say something wrong ?