Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

lingo script

Posted on 2003-02-21
8
Medium Priority
?
912 Views
Last Modified: 2013-12-24
Im definitely new in director, but i already familiar with its environment co'z i take some of its tutorial. I have difficultly manipulating lingo script, im planning to make a game like "Who wants to be a millionnaire", i was able to randomize the questions, but i dont know how will that questions will be disregarded or will not be repeated if its already been asked or answer by the user????  
0
Comment
Question by:enakok
6 Comments
 

Author Comment

by:enakok
ID: 7997581
help me pls!!!
0
 
LVL 2

Expert Comment

by:PeterWitham
ID: 8000096
Just a first thought on it, but you could make an array or list of the questions and then remove that from the active list after the question has been used. Look in to manipulating lists with lingo.

Regards,
Peter Witham
0
 

Accepted Solution

by:
NovusAxis earned 400 total points
ID: 8000161
One simple way of going about it would be to create a property list inside an array.

question = [ ]
question.add( [#VIEWED: FALSE, #prompt: "What is your name?", #correctAnswer: ["Bob", "Robert"]] )

put question[1].question
-- "What is your name?"

If a user wants to see a question, select only questions where the "viewed" property is FALSE--and when they do see a problem, set that value to TRUE.

:) hope that helps
0
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 

Author Comment

by:enakok
ID: 8006700
tnx novusAxis! i got a bit of idea from u but if its ok with u can u pls cite more example, i mean more detailed than the previous?  tnx! it can really help me if you do so!
0
 
LVL 20

Expert Comment

by:MediaMacros
ID: 8008647
You can also use a master list...

questions = ["q1", "q2", "q3"]

Then each time you need a question...

r = random(questions.count)
thisQuestion = questions[r]
questions.deleteAt(r)

This way they never repeat as each is removed once its used.
0
 
LVL 4

Expert Comment

by:nax
ID: 8023570
All the comments above all lead to basically the same idea -- use an array or list in Lingo terms and manipulate it accordingly, but obviously you don't have enough background about Lingo (and I believe programming in general).  I would suggest that you study about basic Lingo programming first so you can understand the suggestions and examples that we provide.  

Anyway, to directly answer your problem, here's a more detailed example of the above suggestions, this will display 5 questions 1 at a time in random order:

1. make a movie script and type this in (I hope you already know about cast members).  This will create a list named "qlist" containing questions 1 to 5.

---
global qlist

on startMovie
  initQuestion()
end

on initQuestion
  qlist=["question 1", "question 2", "question 3", "question 4", "question 5"]
end
---

2. make a text box and position it in the stage.  name this text cast member as "qholder"

3. put a button labelled "Question" in the stage and in the button put this script:

---
global qlist

on beginsprite me
  showQuestion()
end

on showQuestion me
  qp = random(qlist.count)
  member("qholder").text = qlist[qp]
  qlist.deleteAt(qp)
end

on mouseup me
  if qlist.count>1 then
    showQuestion()
  else
    member("qholder").text = "No more questions, press reset"
  end if
end
---

4. put another button labelled "Reset" in the stage and put this script:

---
on mouseup me
  initQuestion()
end
---

try this script and let us know if that's what you're looking for.  if it works, ask any part which you don't understand and I'll gladly explain it to you, just remember there's a help menu in director -- that's very useful.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question