?
Solved

lingo script

Posted on 2003-02-21
8
Medium Priority
?
910 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
Suggested Courses

777 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