38 Replies Latest reply on Mar 27, 2008 7:47 PM by Howard_Stern

    Creating a List Kornfusion!

    Howard_Stern
      I have a list of six numbers in one set.
      I have a second and a third set with different numbers, but still six numbers.
      I have a total of one hundred such lists I need to get into Director to run a basic, tic-tac-toe pattern check, but have no idea where to begin. This is true even though I have created full-on games with Director.

      Can anybody help?
        • 1. Re: Creating a List Kornfusion!
          Level 7
          What part of this are you having trouble with?
          Getting the lists into Director? If so, what format is the data currently?
          Creating a routine to mine whatever information from them? If so, please
          be more specific by supplying an example list and what you need to
          obtain as a result of passing it through your routine.
          • 2. Re: Creating a List Kornfusion!
            Howard_Stern Level 1
            Ok, take a look at these lists and let us call these my entire collection of tic tac toe sets:

            (This is catalogued set number 1)

            cat, cab, bat, tab, all, can, nat, tan, fat

            (This is catalogued set number 2)

            sat, mat, lad, bat, dad, pat, hat, cat, dog

            Now, these numbers are, believe it or not, represent an actual tic-tac-toe session; but in a Linear fashion.
            They go from "word1" to "word9" in each set. Now the hard part:

            I want the program to check for a winner whenever these things happen:
            Is there a word in location "word1?"
            Is there a word in location "word4?"
            and
            Is there a word in location "word9?"
            (This would give a diagonal "win" for tic-tac-toe from top-left to bottom-right)
            Like this, in binary:
            1 0 0
            0 1 0
            0 0 1

            I am trying to get this to check for ALL SETS that I have. Again, I have 100 sets, but I can get the picture if you can help me get these two catalogues to be "checked" by Director for the above pattern. I realize that I will also need to run all of the possible ways to win at tic-tac-toe, but I cannot egin to do that if I can't even get two simple sets to be checked. I realize I will need some sort of true/falses as well.

            How do I get Director to run something like this?
            From scratch?
            Step one: open script right?
            two: write script.
            three: How do I even begin to "stage" this?
            • 3. Re: Creating a List Kornfusion!
              Level 7
              > cat, cab, bat, tab, all, can, nat, tan, fat
              >
              > (This is catalogued set number 2)
              >
              > sat, mat, lad, bat, dad, pat, hat, cat, dog
              >
              > Now, these numbers are, believe it or not, represent an actual tic-tac-toe
              > session; but in a Linear fashion.
              > They go from "word1" to "word9" in each set. Now the hard part:
              >
              > I want the program to check for a winner whenever these things happen:
              > Is there a word in location "word1?"
              > Is there a word in location "word4?"
              > and
              > Is there a word in location "word9?"
              > (This would give a diagonal "win" for tic-tac-toe from top-left to
              > bottom-right)
              > Like this, in binary:
              > 1 0 0
              > 0 1 0
              > 0 0 1

              I'm not sure that I understand, but I think for a diagonal matchg you'd
              need to check 1, *5* and 9; not 1, 4 and 9.

              How do you determine what constitutes a valid word? Perhaps you need a
              "dictionary" that you can do a comparison on:
              if dictionary contains word1 then
              if dictionary contains word5 then
              if dictionary contains word9 then
              -- diagonal win
              end if
              end if
              end if

              Will they always be 3-letter words you need to check against?
              What other "win" conditions are there, or is it only diagonal 1,5,9?


              • 4. Re: Creating a List Kornfusion!
                Howard_Stern Level 1
                Sean,

                I may have confused the issue a lot more than warranted. Let me try again.

                I have 2 lists (catalogue numbers) that I want to run through Director to see if a string of "yeses" add up to a win.
                How? Well, this is an example of the exact situation:

                If I cover each value in catalogue #1 with a post-it note, I would need 9 post-it notes to do so, because there are 9 values in catalogue # 1; and those values are: 1,9,2,8,3,7,4,6,5.

                If I cover each value in catalogue #2 with a post-it note, I would need 9 post-it notes to do so, because there are 9 values in catalogue # 1; and those values are: 11,19,12,18,13,17,14,16,15. ( I simply added 10 to each)

                My mission, peel off three post its to see if there are valid values under each post-it; but not just any post-its, ONLY the post-its over the 1st value, the 5th value and the 9th value, giving me that diagonal pattern.

                Obviously there are values under each post-it and there is definitely going to be a "yes" in the "did I have success in either of these catalogue numbers showing values in the winning positions?" question.

                I am tired of manually looking for this and other patterns manually. Please don't think the problem is as simple as it sounds; it is actually one hundred catalogues deep and the values are strange and unrelated, but if I can get Director to do it with number values, I can get a great idea of how to expand your help to encompass all of the 100 catalogues that I have to actually look for specific value patterns for.

                In real life, there are no post-its over the values, so please don't think that there are. I was just trying to illustrate the idea that I actually have to look, peer or examine these fields individually and let my boss know when the 1,5,9 pattern occurs. (But not exactly, it's way more complicated, so please don't think it is).

                Thanks again,

                Andy.

                • 5. Re: Creating a List Kornfusion!
                  Level 7
                  While you still seem to be over-complicating your situation (or I'm
                  being particularly dense - take your pick!), what's wrong with the
                  pseudo-code I already posted:
                  tList = <return from routine to read in a list, one at a time>
                  if listP(tList) then
                  bSuccess = 0
                  if ilk(tList[1], #integer) then
                  if ilk(tList[5], #integer) then
                  if ilk(tList[9], #integer) then
                  bSuccess = 1
                  end if
                  end if
                  end if
                  else
                  put "expected a list, got:", ilk(tList)
                  end if
                  return bSuccess
                  • 6. Re: Creating a List Kornfusion!
                    Howard_Stern Level 1
                    Sorry, Sean,

                    But that was the first I had ever seen you post anything like that. It was exactly what I needed, I believe!
                    Ok, here are the problems I am having with your code though:

                    tList = <return from routine to read in a list, one at a time>
                    if listP(tList) then
                    bSuccess = 0
                    if ilk(tList[1], #integer) then
                    if ilk(tList[5], #integer) then
                    if ilk(tList[9], #integer) then
                    bSuccess = 1
                    end if
                    end if
                    end if
                    else
                    put "expected a list, got:", ilk(tList)
                    end if
                    return bSuccess

                    Where do I put all this in the script? I mean I made a field, crtl+" script pops up. Do I put it in between the mouseup and end????

                    Thanks a bunch man; you really seem to be on the trail for what I could not conceive!

                    Andy.
                    • 7. Re: Creating a List Kornfusion!
                      Level 7
                      It's difficult to know where to put this script as it depends on how you
                      want to access it, and there's a whole bunch of processing details that
                      aren't clear, like how you're going to read the lists in (assuming
                      they're external files).

                      Place the following code into a #movie script (Ctrl+Shift+U):
                      --
                      on mDiagonalMatch aList
                      if listP(tList) then
                      bSuccess = 0
                      if ilk(tList[1], #integer) then
                      if ilk(tList[5], #integer) then
                      if ilk(tList[9], #integer) then
                      bSuccess = 1
                      end if
                      end if
                      end if
                      else
                      put "expected a list, got:", ilk(tList)
                      end if
                      return bSuccess
                      end

                      So, having assumed you've read in a list and it's in a variable called
                      tList, from your message window (Ctrl+M) you could execute the command:
                      put mDiagonalMatch(tList)
                      -- 1
                      • 8. Re: Creating a List Kornfusion!
                        Howard_Stern Level 1
                        Sean, this is what I've done:

                        As recommended, I put this into the #movie script(I think, but I doubt I did it right))

                        on mDiagonalMatch aList
                        if listP(tList) then
                        bSuccess = 0
                        if ilk(tList[1], #integer) then
                        if ilk(tList[5], #integer) then
                        if ilk(tList[9], #integer) then
                        bSuccess = 1
                        end if
                        end if
                        end if
                        else
                        put "expected a list, got:", ilk(tList)
                        end if
                        return bSuccess
                        end

                        Ok, it looks like this is some sort of window that will exist even if there is no button hit or mouseup, which is coll I suppose, for I was wondering if I had to create a field just to access any kind of script.

                        Global, Internal 1-right?

                        Now, you wondered about my actual list data. They are not external files; my two lists are right here:

                        10,20,30,40,50,60,70,80,90

                        or

                        10 40 70
                        20 50 80
                        30 60 90

                        and the second list:

                        1,2,3,4,5,6,7,8,9

                        or

                        1 4 7
                        2 5 8
                        3 6 9

                        I can put them into Director thusly: MyList = [1,2,3,4,5,6,7,8,9], but I don't want to if it's only going to mean you have to rewrite your entire tip for this.
                        I can call them whatever you want just for the meanwhile; SeanList and AndyList is cool with me.

                        Make no mistake, I obviously am not familiar with the shortcut keys to open things up, nor have I ever worked with lists before, but for 6 weeks now, yours has been the best advice to date.

                        Believe me, Sean, if your next question to me begins with "Did you..."- I can tell you its a "no" for sure, because after pasting that last code into the global movie 1, I realized I was back at square one not knowing where to put my values.

                        Can you suggest a place?
                        • 9. Re: Creating a List Kornfusion!
                          Level 7
                          > Now, you wondered about my actual list data. They are not external files; my
                          > two lists are right here:
                          >
                          > 10,20,30,40,50,60,70,80,90
                          >
                          > or
                          >
                          > 10 40 70
                          > 20 50 80
                          > 30 60 90
                          >
                          > and the second list:
                          >
                          > 1,2,3,4,5,6,7,8,9
                          >
                          > or
                          >
                          > 1 4 7
                          > 2 5 8
                          > 3 6 9

                          The impression I had was that you were trying to automate a long-winded
                          process - which by implication was checking data produced by some other
                          application. This is why I anticipated your data needed to be read in
                          when your "program" runs. Whatever.
                          Unfortunately, the examples you posted aren't lists, despite your
                          starting this thread by stating they were. So now you need another
                          routine that will transform comma-delimited string data into a list. I
                          *have* to assume that they are strings since you are so vague with
                          details. How have you "stored" this data in Director - is it in #field
                          or #text members? If so, how did you get it there in the first place?

                          In the same #movie script you could add the following:
                          --
                          on mStringToList str
                          lReturn = []
                          the itemDelimiter = ","
                          repeat with n = 1 to the number of items of str
                          lReturn.append( integer(str.item[l]) )
                          end repeat
                          return lReturn
                          end

                          And again from your message window you could execute:
                          andysList = mStringToList("10,20,30,40,50,60,70,80,90")
                          put mDiagonalMatch(andysList)
                          -- 1
                          • 10. Re: Creating a List Kornfusion!
                            Howard_Stern Level 1
                            Sean,

                            I am truly sorry this is taking so long. I probably should have started a thread another way.

                            Sean, let me tell you, I am amazed by your stick-to-itiveness with my problem in Director. When I finally get to where I am hoping with it, it will all because of your posts and replies somehow.

                            Would it be easier if you wrote something like this in your next one:

                            "Ok, hit ctrl+u to open window X, copy and paste the following code in there.

                            Now, hit ctrl+? to open this other one and put in your numbers (values) and do it without the commas, for it will be all the more efficient in the end.

                            Now, you have all you need to have Director run the task, but you will need to get it to display some action on the screen before you are 100% done."

                            I hate bothering you so much, having to write script after script because of my jumbled thought process and naivete.

                            If this is possible, here are the example numbers in the first set: (though they can be whatever numbers you wish, as it is just an example)
                            1 2 3 4 5 6 7 8 9

                            The second set
                            9 8 7 6 5 4 3 2 1

                            Hopelessly,

                            Andy in Los Angeles.
                            • 11. Re: Creating a List Kornfusion!
                              McFazstp Level 1
                              I'm a little confused as to what the actual question is?

                              Is this a classic tic-tac-toe with the noughts and crosses grid? How do these relate to the 'words' you refer to in word1, word4 etc.?

                              I take it the end result you are looking for is working out your program's next move when someone places a nought or cross in the grid?

                              • 12. Re: Creating a List Kornfusion!
                                Level 7
                                > If this is possible, here are the example numbers in the first set: (though
                                > they can be whatever numbers you wish, as it is just an example)
                                > 1 2 3 4 5 6 7 8 9
                                >
                                > The second set
                                > 9 8 7 6 5 4 3 2 1

                                You keep shifting the goal posts! Last time your values were
                                comma-delimited, now they're space-delimited. Why are you being so
                                inconsistent? I guess it's because you don't yet have the data you're
                                trying to analyse - I've asked a number of times how it's stored and you
                                haven't yet answered.
                                • 13. Re: Creating a List Kornfusion!
                                  Howard_Stern Level 1
                                  I'm a little confused as to what the actual question is?

                                  -----I'm sorry, man, again, I'm sure I keep mucking it up further by trying to come up with simpler examples.

                                  Is this a classic tic-tac-toe with the noughts and crosses grid? How do these relate to the 'words' you refer to in word1, word4 etc.?

                                  -----Yes, it is a tic-tac-toe pattern. They do not relate to the "words" from way earlier posts (ex. (word1 word2 word3). Those words were only a way for me to illustrate a bad example. Why bad? Because then the door is open for non-crucial issues such as spelling and definition of "mop" or "map" to come up and hinder progress. So I decided to go with numbers.

                                  I take it the end result you are looking for is working out your program's next move when someone places a nought or cross in the grid?

                                  -----Not at all. No next moves, nothing like that at all. The only thing I am trying to do is work out a proof-of-concept. I need Director to go through a list, ANY list of values and tell me whether or not any value at all exists in Specific Locations in the list of Values.

                                  Example, like we discussed:

                                  Does A VALUE, any value, EXIST in "space" 1

                                  Does A VALUE, any value, EXIST in "space" 5

                                  Does A VALUE, any value, EXIST in "space" 9 of the values list.


                                  -----I know this time around I did not use commas, but this is only because it seemed to slow progress down.

                                  The truth is, like I mentioned, you can choose the values, but keep them numbers and keep it 9 values long and those values will serve perfectly, commas or not (for my purposses, but I don't know if Director requires them).

                                  -----I can't overstate the following:

                                  All I need is for the program to check for...

                                  Does A VALUE, any value, EXIST in "space" 1

                                  Does A VALUE, any value, EXIST in "space" 5

                                  Does A VALUE, any value, EXIST in "space" 9 of the values list in list 1

                                  and

                                  Does A VALUE, any value, EXIST in "space" 1

                                  Does A VALUE, any value, EXIST in "space" 5

                                  Does A VALUE, any value, EXIST in "space" 9 of the values list 2.

                                  Before you ask, there is no list 1 and 2; I'm only trying to get any two numerical based lists "read" by Director to yield a yes or no answer to my "Does a VALUE exists in___" question for TWO separate sets of values.


                                  -----No, I do not need the program to allow for a player to place a value in one of the tic-tac-toe spaces; for like I mentioned, all of the "games" have been catalogued and numbered and they will number 100 (catalogue numbers).

                                  -----Remember, this is to serve as a "history" checker of 100 games all ready played. As it grows, it will become much, much more complex and the number of games listed will exceed 10,000; but this is not important at this stage. It is only important that a proof-of-concept be provided to prove that Director can carry this task out.
                                  Obviously at this point in the process, all 100 "histories" will be a winner, but as the number grows and becomes many, many more than 9 values, I will be able to take what you have helped me with and expound on it.

                                  -----Sean, please remember, this tic-tac-toe thing is a metaphor for what takes 8 man hours every workday to do at my workplace. No, there is "no" actual tic-tac-toe game collection, but it's concept is exatly the same as what we do at our workplace and pay hundreds of dollars a week to do. Which is silly if Director can accomplish the same task easily.

                                  But if we continue to think of this as a tic-tac-toe game, it will not hurt a bit. In reality it is an Online War Game in development, dealing with thousands and thousands of these tic-tac-toe patterns all stuck together, side by side. We are trying to digitize the game's "battlefield" into these little tic-tac-toe squares.
                                  We currently do it all by hand and it takes a whole week to move from one round of the game to the next. Digitizing this process will help tremendously as you can imagine.
                                  But please don't let these facts make you to believe that my current goal of only 9 values is bogus and irrelevant.


                                  All I need is for the program to check for...

                                  Does A VALUE, any value, EXIST in "space" 1

                                  Does A VALUE, any value, EXIST in "space" 5

                                  Does A VALUE, any value, EXIST in "space" 9 of the values list in list 1 and list 2 (again the actual values are totally up to you, if it will make it easier).

                                  Believe me, the goal posts are still where they were, if you look at my first two posts, but I did mistakenly put "6" numbers instead of 9; but that is a minor issue, since it seems checking for even 3 numbers is proving next to impossible.

                                  Thanks for the help and understanding,

                                  Andy in Los Angeles.
                                  • 14. Re: Creating a List Kornfusion!
                                    Level 7
                                    Getting information from you sometimes feels like I'm pulling your teeth
                                    - you're *very* reluctant to part with anything!

                                    So: you already have a data set; it's going to scale up (x 100); and
                                    it's not Director that's producing this data.

                                    To avoid goal-post shifting, is there any chance you can provide a
                                    sample of the data in its "raw" form - that is, without you trying to
                                    simplify it and in practise over-complicating the issue?
                                    • 15. Re: Creating a List Kornfusion!
                                      Howard_Stern Level 1
                                      Sean,


                                      Yes I do. Here it is:

                                      (first set)

                                      1 2 3 4 5 6 7 8 9

                                      (second set)

                                      2 3 4 5 6 7 8 9 1

                                      That is all I need for proof of concept. I know they might look familiar.

                                      checking for pattern "1, 5, 9" as discussed above. "why these numbers? because they represent "terrain values of the 'locations' they appear on in the game map. for example, a fortification is a 9 and a paved highway is a 1; but we are only looking for number values to be run into Director-not "highway1" or "fort9".

                                      Thanks,

                                      We're sounding really close,

                                      Andy in Los Angeles.
                                      • 16. Re: Creating a List Kornfusion!
                                        Howard_Stern Level 1
                                        Of course, if you meant what the map looks like, well it looks just like a tic-tac-toe or a pound sign on your keyboard you are typing on right above the "3" key.
                                        • 17. Re: Creating a List Kornfusion!
                                          McFazstp Level 1
                                          Hi Andy. I feel like I'm in Hitchhiker's Guide to the Galaxy. We have the answer we just don't know the question.


                                          • 18. Re: Creating a List Kornfusion!
                                            Howard_Stern Level 1
                                            Hello to Both of you,

                                            I am sorry it took me so very long to get back; my wife and I went into Labor Thursday at 4:45 p.m. PDT.

                                            I can't wait to try the code above and let you know what happens.

                                            Sean, if you are still watching, thank you my friend.

                                            It was a boy.

                                            Andy.
                                            • 19. Re: Creating a List Kornfusion!
                                              Level 7
                                              > It was a boy.

                                              Congratulations! I hope mother and son are both well.
                                              • 20. Re: Creating a List Kornfusion!
                                                Howard_Stern Level 1
                                                Thanks man,

                                                Al was well, even though it was a C-Section, but you know what bugged me the most after sleeping almost 4 hours total in the Hospital from Thursday to today, the 18th is the fact that I could not check what was developing in this string. I felt I left you hanging without letting you know. It all began so fast-I apologize and hope you will check out a picture of him tomorrow if I make a flickr.

                                                On the code... I get a Handler Exception error messsge "mylist? = 1 2 3 4 5 6 7 8 9" when I close it.
                                                This is nothing new though. There must be more to this than copy and paste inside the controlshift=U screen.

                                                Just two things I wonder about, when I see "put" in the code, I think "put it where?" I don't even have a field for it to display on the stage. Is doing so necessary?

                                                Another, are the words in Red for my eyes only, or are you asking me a question? Because I actually pasted the whole thing into the cntrlShftU screen.

                                                Or am I to decide which one I am trying to run then only copy and paste that code?

                                                This is nothing new, Sean knows the cycle of kornfusion lives well in my world.

                                                Maybe I need to begin each Reply with "Hello, I am 8 years old, can you help me do this step by step?"

                                                If anyone reading this code does the same with my values, does it work for you?
                                                • 21. Re: Creating a List Kornfusion!
                                                  Howard_Stern Level 1
                                                  Thanks man,

                                                  Al was well, even though it was a C-Section, but you know what bugged me the most after sleeping almost 4 hours total in the Hospital from Thursday to today, the 18th is the fact that I could not check what was developing in this string. I felt I left you hanging without letting you know. It all began so fast-I apologize and hope you will check out a picture of him tomorrow if I make a flickr.

                                                  On the code... I get a Handler Exception error messsge "mylist? = 1 2 3 4 5 6 7 8 9" when I close it.
                                                  This is nothing new though. There must be more to this than copy and paste inside the controlshift=U screen.

                                                  Just two things I wonder about, when I see "put" in the code, I think "put it where?" I don't even have a field for it to display on the stage. Is doing so necessary?

                                                  Another, are the words in Red for my eyes only, or are you asking me a question? Because I actually pasted the whole thing into the cntrlShftU screen.

                                                  Or am I to decide which one I am trying to run then only copy and paste that code?

                                                  This is nothing new, Sean knows the cycle of kornfusion lives well in my world.

                                                  Maybe I need to begin each Reply with "Hello, I am 8 years old, can you help me do this step by step?"

                                                  If anyone reading this code does the same with my values, does it work for you?
                                                  • 22. Re: Creating a List Kornfusion!
                                                    Howard_Stern Level 1
                                                    Thanks man,

                                                    Al was well, even though it was a C-Section, but you know what bugged me the most after sleeping almost 4 hours total in the Hospital from Thursday to today, the 18th is the fact that I could not check what was developing in this string. I felt I left you hanging without letting you know. It all began so fast-I apologize and hope you will check out a picture of him tomorrow if I make a flickr.

                                                    On the code... I get a Handler Exception error messsge "mylist? = 1 2 3 4 5 6 7 8 9" when I close it.
                                                    This is nothing new though. There must be more to this than copy and paste inside the controlshift=U screen.

                                                    Just two things I wonder about, when I see "put" in the code, I think "put it where?" I don't even have a field for it to display on the stage. Is doing so necessary?

                                                    Another, are the words in Red for my eyes only, or are you asking me a question? Because I actually pasted the whole thing into the cntrlShftU screen.

                                                    Or am I to decide which one I am trying to run then only copy and paste that code?

                                                    This is nothing new, Sean knows the cycle of kornfusion lives well in my world.

                                                    Maybe I need to begin each Reply with "Hello, I am 8 years old, can you help me do this step by step?"

                                                    If anyone reading this code does the same with my values, does it work for you?
                                                    • 23. Re: Creating a List Kornfusion!
                                                      stephen_
                                                      Hi Andy,
                                                      Congrats on the bub. fazstp here. For some reason my old login wouldn't work.

                                                      If you have the code as is in your post.
                                                      mylist = 1 2 3 4 5 6 7 8 9

                                                      You need to wrap it in something. If it's meant to be a string you need
                                                      mylist = "1 2 3 4 5 6 7 8 9"

                                                      If it's meant to be a list you need
                                                      mylist = [1, 2, 3, 4, 5, 6, 7, 8, 9]

                                                      Text in red preceded by -- are comments. They don't actually execute but are there to explain parts of the code to anyone editing the script. They can be handy when you come back to a script a few years down the track because it's not always obvious what's going on.

                                                      The put command writes the text to the message window ( ctrl-m ).

                                                      If you copy my code just paste the handlers into a script member. The first part was just an example of how you might use the handlers. Or could wrap it in another handler to fix the error.

                                                      on Test
                                                      my_string = "1 2 3 4 5 6 7 8 9"
                                                      my_list = convertStringToList( my_string )

                                                      if checkList( my_list, [1, 5, 9] ) then
                                                      put "You are winner!"
                                                      else
                                                      put "Sorry"
                                                      end if
                                                      end Test

                                                      • 24. Re: Creating a List Kornfusion!
                                                        Howard_Stern Level 1
                                                        Ok, see-I knew it! There is something I have to do other than simply paste.

                                                        Ok, so I'm going to create a mouseup button for starters, then I will post as much and this way it can be step, by step.

                                                        Thank you.
                                                        • 25. Re: Creating a List Kornfusion!
                                                          Howard_Stern Level 1
                                                          I created a cast member, this is what I pasted:

                                                          on mouseUp
                                                          on Test
                                                          my_string = "1 2 3 4 5 6 7 8 9"
                                                          my_list = convertStringToList( my_string )

                                                          if checkList( my_list, [1, 5, 9] ) then
                                                          put "You are winner!"
                                                          else
                                                          put "Sorry"
                                                          end if
                                                          end Test
                                                          end

                                                          I know I need to do something else. Something before Mouse up, perhaps, but am not sure if you want me to use use string, list or both.

                                                          Did I begin incorrectly?

                                                          Let us assume I am beginning a new File (movie) for Director. I have a blank stage and some numbers I want to run through Director 1-9.

                                                          Should I have created a mouseup field?



                                                          • 26. Creating a List Kornfusion!
                                                            stephen_ Level 1
                                                            In that case remove the

                                                            on Test

                                                            and

                                                            end Test

                                                            Basically these define your 'handler'. Everything between 'on' and 'end' are the Test handler. As you have used the mouseUp for your handler you don't need the Test handler within it.

                                                            I'm a little confused by your claim in the first post that you created full-on games with Director?

                                                            If you read the Director help docs they are pretty comprehensive. I'm all for learning by doing but you need to know the basics.

                                                            Of course that's not to say don't post questions. I'm just saying that without the basics any response won't get you far.

                                                            • 27. Re: Creating a List Kornfusion!
                                                              Howard_Stern Level 1
                                                              Yes, as a thesis project I created a game with animations for elementary kids to learn contractions in the area of Language Arts. I got an "A" in the class actually, but what I never, ever did was use Lists.

                                                              I will try what you just wrote and repost.
                                                              • 28. Re: Creating a List Kornfusion!
                                                                Howard_Stern Level 1
                                                                Steven,

                                                                I think I made awesome progress! THis is what happened when I removed what you said to:

                                                                on mouseUp
                                                                my_string = "1 2 3 4 5 6 7 8 9"
                                                                my_list = convertStringToList( my_string )

                                                                if checkList( my_list, [1, 5, 9] ) then
                                                                put "You are winner!"
                                                                else
                                                                put "Sorry"
                                                                end if
                                                                end

                                                                SCRIPT ERROR: HANDLER NOT DEFINED

                                                                my_list=convertstringtolist(my_string)
                                                                #convertstringtolist

                                                                But for the very first time, I was able to run the movie and actually get to click on the field that was created. THe above error happened thereafter.

                                                                Thanks, Stephen. I think we are close.
                                                                • 29. Re: Creating a List Kornfusion!
                                                                  Howard_Stern Level 1
                                                                  Thank you both so much for trying to help me.

                                                                  To view newborn, http://www.flickr.com/photos/24269890@N06/2347817605/

                                                                  It seems like it would take either of you 45 seconds to do exactly what I am trying to do. Could one of you see if you can get Director to do this?
                                                                  • 31. Re: Creating a List Kornfusion!
                                                                    Level 7
                                                                    stephen_ wrote:
                                                                    > Try this
                                                                    >
                                                                    > http://home.iprimus.com.au/fazstp/andy_test.zip
                                                                    >
                                                                    >


                                                                    I think he is using 8.5, so that frame loop written in javascript format
                                                                    is going to generate an error. Easy to fix but....
                                                                    • 32. Re: Creating a List Kornfusion!
                                                                      stephen_ Level 1
                                                                      Oh right.

                                                                      If that's the case Andy just change

                                                                      go _movie.frame

                                                                      to

                                                                      go the frame

                                                                      • 33. Re: Creating a List Kornfusion!
                                                                        Howard_Stern Level 1
                                                                        The AndyTest Movie---

                                                                        I can't seem to get it do do anything. I mean, I don't see a change when I click on the button. ? Should I be looking elsewhere for the result?
                                                                        • 34. Re: Creating a List Kornfusion!
                                                                          stephen_ Level 1
                                                                          The result is written into the field below the button. I guess it just doesn't look like it's doing anything because I didn't clear the field. If you add a behaviour to the text field below the button containing the following;

                                                                          on beginSprite me
                                                                          put EMPTY into sprite( me.spriteNum ).member
                                                                          end

                                                                          • 35. Re: Creating a List Kornfusion!
                                                                            Level 7
                                                                            You can also see a result if you change the text field (such as delete
                                                                            the 9) then press the button, you get "Sorry". Put the 9 back, press the
                                                                            button and you get the "Winner" message.


                                                                            stephen_ wrote:
                                                                            > The result is written into the field below the button. I guess it just doesn't
                                                                            > look like it's doing anything because I didn't clear the field. If you add a
                                                                            > behaviour to the text field below the button containing the following;
                                                                            >
                                                                            > on beginSprite me
                                                                            > put EMPTY into sprite( me.spriteNum ).member
                                                                            > end
                                                                            >
                                                                            >
                                                                            >
                                                                            • 36. Re: Creating a List Kornfusion!
                                                                              Howard_Stern Level 1
                                                                              I see now how the 1 2 3 4 5 6 7 8 9 renders a win for the player, but if I try to add a new group of numbers for it to check-it reads "sorry". I even tried to put a 1 in the first column, a 5 in the fifth and a 9 in the ninth. Do you know how I can make it read a slew of numbers.

                                                                              Example:
                                                                              1 2 3 4 5 6 7 8 9 (it all ready does), looking for 1,5,9
                                                                              Trying to get it to scan [1 2 3 4 5 5 5 5 9] as well.
                                                                              • 37. Re: Creating a List Kornfusion!
                                                                                stephen_ Level 1
                                                                                If you type it in with the square brackets it sees the first number as "[1" and the last as "9]" which will fail the check.

                                                                                • 38. Re: Creating a List Kornfusion!
                                                                                  Howard_Stern Level 1
                                                                                  What are you saying though? If I type what? the 1 2 3 4 5 5 5 5 9 above?

                                                                                  I'm not trying to get it to fail; it's the whole trying to get it to scan another set of numbers for the exact same win scenario of 1,5,9 (positions).

                                                                                  Two catalogs for it to scan through, the one that all ready does work in the Andytest, and one that I have yet to put into it. This one: 1 2 3 4 5 5 5 5 9