Author Topic: list equal list if statement  (Read 11953 times)

0 Members and 2 Guests are viewing this topic.

Offline MRide

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 711
  • Rating: +14/-0
  • You can't see this.
    • View Profile
list equal list if statement
« on: September 02, 2010, 09:41:11 pm »
Is it possible to have "If L1=L2"?
Specifically, I'm trying to add two lists together and see if they equal a third.  I realize this is possible through a For( loop, but it seems too simple not to have a command that does this.

_player1537

  • Guest
Re: list equal list if statement
« Reply #1 on: September 02, 2010, 09:43:33 pm »
If Min(L1=L2

Offline MRide

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 711
  • Rating: +14/-0
  • You can't see this.
    • View Profile
Re: list equal list if statement
« Reply #2 on: September 02, 2010, 09:57:16 pm »
Thanks, I thought it would be that simple.  I should really make sure I know all the list commands.

_player1537

  • Guest
Re: list equal list if statement
« Reply #3 on: September 02, 2010, 11:06:29 pm »
It actually took me a while to get that statement :P  I needed it for a project a long time ago :)

Offline MRide

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 711
  • Rating: +14/-0
  • You can't see this.
    • View Profile
Re: list equal list if statement
« Reply #4 on: September 02, 2010, 11:12:56 pm »
Oh, well now I don't feel so bad. :P

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: list equal list if statement
« Reply #5 on: September 02, 2010, 11:18:50 pm »
Why does that work exactly?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

_player1537

  • Guest
Re: list equal list if statement
« Reply #6 on: September 02, 2010, 11:21:23 pm »
Ok, lets say L1 = {1,2,0,4} and L2 = {1,2,3,0}
L1 = L2 == {1,1,0,0}
min({1,1,0,0}) = 0

Now if L1 = {1,2,3,4} and L2 = {1,2,3,4}
L1 = L2 == {1,1,1,1}
min({1,1,1,1}) = 1

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: list equal list if statement
« Reply #7 on: September 02, 2010, 11:28:02 pm »
Oh, ok. So basically you're just testing to see if there is a zero in any of the boolean between the lists?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

_player1537

  • Guest
Re: list equal list if statement
« Reply #8 on: September 02, 2010, 11:29:45 pm »
Yep, which would mean that one of the elements is not the same :)

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: list equal list if statement
« Reply #9 on: September 02, 2010, 11:47:35 pm »
WOW, thanks so much for this! I never thought about doing that. I remember back in 2002 or 2003 I wondered how to do that, and never figured out. Nice trick you got there!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: list equal list if statement
« Reply #10 on: September 03, 2010, 01:07:22 am »
I love things like this :) Basic has its perks!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: list equal list if statement
« Reply #11 on: September 03, 2010, 05:46:26 pm »
Yep, and there are still some crazy optimizations that I can never get no matter how long I stare at them :D




Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: list equal list if statement
« Reply #12 on: September 03, 2010, 06:07:26 pm »
Yep, and there are still some crazy optimizations that I can never get no matter how long I stare at them :D

Like what?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: list equal list if statement
« Reply #13 on: September 03, 2010, 06:08:14 pm »
Like binomcdf( (or pdf, I don't remember). I don't get how it works :P




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: list equal list if statement
« Reply #14 on: September 03, 2010, 06:46:31 pm »
Yeah same here. if you read one of the Illusiat 13 topics, Galandros explained it thoroughly and then I checked the TIBD page a few times. I never managed to understand how it works. so I stuck with a slower alternative x.x