Author Topic: Important life algorithms  (Read 30565 times)

0 Members and 1 Guest are viewing this topic.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Important life algorithms
« Reply #15 on: November 20, 2014, 05:37:56 pm »
If I cannot code
  Pretend like I can
End pretending
If you like my work: why not give me an internet?








Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Important life algorithms
« Reply #16 on: December 20, 2014, 03:05:05 pm »
void warranty()
If you like my work: why not give me an internet?








Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Important life algorithms
« Reply #17 on: December 20, 2014, 04:21:54 pm »
This needs to be inside an If storeName != Walmart block :P

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Important life algorithms
« Reply #18 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!

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Important life algorithms
« Reply #19 on: December 22, 2014, 02:35:21 am »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Important life algorithms
« Reply #20 on: December 22, 2014, 04:47:58 am »
Those are great :D
If you like my work: why not give me an internet?








Offline bb010g

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 428
  • Rating: +22/-1
  • I do stuff
    • View Profile
    • elsewhere on the net
Re: Important life algorithms
« Reply #21 on: December 23, 2014, 04:28:26 pm »
Arch Linux user
Haskell newbie | Warming up to Lua | Being dragged into C++
Calculators: HP 50g, HP 35s, Casio Prizm, TI-Nspire CX CAS, HP 28s, HP Prime, Mathematica 9 (if that counts)
π: 3.14...; l: 108; i: 105; e: 101; l+i+e: 314
THE CAKE IS A LIE IS A PIE

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Important life algorithms
« Reply #22 on: December 23, 2014, 04:35:25 pm »
Code: [Select]
#define if(x) if(rand()%10 && (x))

Happy debugging! :p

Offline bb010g

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 428
  • Rating: +22/-1
  • I do stuff
    • View Profile
    • elsewhere on the net
Re: Important life algorithms
« Reply #23 on: December 24, 2014, 12:34:22 am »
Code: [Select]
while(oreo)
    oreo--;
Looking though this again, you could optimize:
Code: [Select]
while(oreo--);
Arch Linux user
Haskell newbie | Warming up to Lua | Being dragged into C++
Calculators: HP 50g, HP 35s, Casio Prizm, TI-Nspire CX CAS, HP 28s, HP Prime, Mathematica 9 (if that counts)
π: 3.14...; l: 108; i: 105; e: 101; l+i+e: 314
THE CAKE IS A LIE IS A PIE

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Important life algorithms
« Reply #24 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();
    }
}
« Last Edit: December 24, 2014, 02:35:49 pm by epic7 »

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Important life algorithms
« Reply #25 on: December 24, 2014, 02:33:04 pm »
True statement. Except I didn't even mention it today...
I am Bach.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Important life algorithms
« Reply #26 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

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Important life algorithms
« Reply #27 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
I am Bach.

Offline harold

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 226
  • Rating: +41/-3
    • View Profile
Re: Important life algorithms
« Reply #28 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.
Blog about bitmath: bitmath.blogspot.nl
Check the haroldbot thread for the supported commands and syntax.
You can use haroldbot from this website.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Important life algorithms
« Reply #29 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:
« Last Edit: December 24, 2014, 05:35:29 pm by Keoni29 »
If you like my work: why not give me an internet?