
-----------------------------------
Namis
Wed Sep 24, 2003 11:24 pm

Multiple If's
-----------------------------------
Heres my code ;o

put " Would you like some music while you answer my 20 questions?  or  "
if yes = "yes" or yes = "Yes" or yes = "YES" or yes = "YeS" or yes = "yES" or yes = "YEs" or yes = "yeS" or yes = "yEs"
        then
    put " Cool! Which band would you like to listen to? "
    delay (2000)
    put "  or  or  "
    get music
    if music = "tool" or music = "Tool" or music = "TOOL" or music = "ToOl" or music = "TOol" or music = "tOOl" or music = "TOOl" or music = "ToOL"
            then
        put " Great Choice, Tool - Schism, will now play "
        delay (1000)
    %testing
Music.PlayFile ("C:\\Documents and Settings\Andrew\Desktop\Music\Tool\Lateralus.mp3")
end if

now for the other bands, ( and more songs after i figure out how this works ) do i keep it all under 1 if statement? or do i use multiple if statements? or do i j ust change the command line to

if music = "malicemizer" or
if music = "aperfectcircle" etc?
Something like this? 
tool/malicemizer/aperfectcircle being different bands.

-----------------------------------
Namis
Wed Sep 24, 2003 11:24 pm


-----------------------------------
put " Would you like some music while you answer my 20 questions?  or  "
if yes = "yes" or yes = "Yes" or yes = "YES" or yes = "YeS" or yes = "yES" or yes = "YEs" or yes = "yeS" or yes = "yEs"
        then
    put " Cool! Which band would you like to listen to? "
    delay (2000)
    put "  or  or  "
    get music
    if music = "tool" or music = "Tool" or music = "TOOL" or music = "ToOl" or music = "TOol" or music = "tOOl" or music = "TOOl" or music = "ToOL"
           then
        put " Great Choice, Tool - Schism, will now play "
        delay (1000)
    %testing
Music.PlayFile ("C:\\Documents and Settings\Andrew\Desktop\Music\Tool\Lateralus.mp3")
end if
    if music = "malicemizer"
           then
        put " Great Choice, Malice Mizer - Baroque, will now play "
        delay (1000)
    %testing
Music.PlayFile ("C:\Documents and Settings\Andrew\Desktop\Music\Malice Mizer\CD4MEPLZ\Baroque.mp3")
end if
    if music = "aperfectcircle"
     then
        put " Great Choice, A Perfect Circle - Three Libras, will now play "
        delay (1000)
    %testing
Music.PlayFile ("C:\Documents and Settings\Andrew\Desktop\Music\A Perfect Circle\Three Libras.mp3")
end if

-----------------------------------
Tony
Wed Sep 24, 2003 11:29 pm


-----------------------------------
come on, there's a tutorial on elsif's [url=http://www.compsci.ca/v2/viewtopic.php?t=367]right here

I know you know its there because you even replied to that some time ago.  :? 

Anyways, you need to make your program more organized. There're way to many ifs inside other ifs.

Also you should use a function that changes string to all caps (or all small) so that you dont write out two lines of possible input. Someone already wrote it, was probly even a re to one of your previous topics.

-----------------------------------
Namis
Wed Sep 24, 2003 11:30 pm


-----------------------------------
Yeah im a retard, stab me in the face.

and if you think that is unorganized you should see the rest of my code, i get lost just looking at it :o

-----------------------------------
Tony
Wed Sep 24, 2003 11:33 pm


-----------------------------------
Yeah im a retard, stab me in the face

*Tony stabs Namis in his face  :twisted: *

-----------------------------------
Amailer
Wed Sep 24, 2003 11:55 pm


-----------------------------------
Yeah im a retard, stab me in the face

*Tony stabs Namis in his face  :twisted: *

how evil lol

-----------------------------------
Blade
Thu Sep 25, 2003 5:18 pm


-----------------------------------
Yeah im a retard, stab me in the face

*Tony stabs Namis in his face  :twisted: *


ROCK ON MAN!!!! i wanted to stab him in the face but i didnt get here till later :(

-----------------------------------
krishon
Thu Sep 25, 2003 5:55 pm


-----------------------------------
even tho there are lots of ifs...some times...u hafta put some ifs inside others...especially in games.  You must write the code for every single possiblilty (which is sometimes an ass)

-----------------------------------
PaddyLong
Thu Sep 25, 2003 10:04 pm


-----------------------------------
man... you would be so better off writing some function to compare whether some variable is equal (case insensitive) to some word...

something like this...


function wordsEqual (input, actualString : string) : boolean
    if length (input) not= length (actualString) then
        result false
    end if

    for i : 1 .. length (input)
        if ord (actualString (i)) >= 65 and ord (actualString (i)) = 97 and ord (actualString (i)) 