Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: MIA, Ask an Expert
From: "Alain Tougas" <alain@xxxxxxx>
Date: Mon, 21 Apr 2008 13:42:12 -0400

Hello,

The problem was minor, really. The correct procedure is:

TO STARTUP
MAKE "NOUN [DOG CAT HOUSE CAR CHILD COMPUTER]
MAKE "VERB [WALKS RUNS SKIPS FLIES SMELLS SLEEPS]
MAKE "ADJECTIVE [TINY LIGHT BLUE QUICK]
MAKE "ARTICLE [THE A]
MAKE "NL []
MAKE "FS [.]
MAKE "CM [,]
END

TO WRITE :TEMPLATE
IF :TEMPLATE = [] [PRINT [] STOP]
MAKE  "WORD FIRST :TEMPLATE
IFELSE (FIRST :WORD) = ""
    [INSERT BUTFIRST :WORD INSERT CHAR 32]
    [INSERT RAND THING FIRST :TEMPLATE INSERT CHAR 32]
IF (FIRST :TEMPLATE) = "NL [PRINT "]
WRITE BUTFIRST :TEMPLATE
END

TO RAND :DICT
IF :DICT = [] [OUTPUT[]]
MAKE "NUMBER 1 + RANDOM COUNT :DICT
OUTPUT ITEM :NUMBER :DICT
END

The only difference is
IFELSE (FIRST :WORD) = ""
which means "if the first element of the value of the variable "word" is a
quote, then do that..."

That allows you to use the procedure in the following ways:
write [article noun adjective verb]
or
write [article noun adjective verb "too "much]

and "force" the words "too much" in your random sentence.

Alain

-----Original Message-----
From: mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
[mailto:mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
askanexpert@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sent: Monday, April 21, 2008 5:25 AM
To: askanexpert@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: MIA, Ask an Expert


This is an automatic message sent from the web form at:
http://www.openworldlearning.org/mia/howdoi.htm

from: Renee <rstevenson3@xxxxxxxxxxx>
date: Mon Apr 21 03:25:22 2008
platform: Platform not specified
version: MicroWorlds Ex

Hello,

I have inserted the following procedures into the microworlds ex
application:

TO STARTUP
MAKE "NOUN [DOG CAT HOUSE CAR CHILD COMPUTER]
MAKE "VERB [WALKS RUNS SKIPS FLIES SMELLS SLEEPS]
MAKE "ADJECTIVE [TINY LIGHT BLUE QUICK]
MAKE "ARTICLE [THE A]
MAKE "NL []
MAKE "FS [.]
MAKE "CM [,]
END

TO WRITE :TEMPLATE
IF :TEMPLATE = [] [PRINT [] STOP]
MAKE  "WORD FIRST :TEMPLATE
IFELSE (FIRST :WORD) = " "[INSERT BUTFIRST  :WORD INSERT CHAR 32][INSERT
RAND THING FIRST :TEMPLATE INSERT CHAR 32]
IF (FIRST :TEMPLATE) = "NL [PRINTâ??]
WRITE BUTFIRST :TEMPLATE
END

TO RAND :DICT
IF :DICT = [] [OUTPUT[]]
MAKE "NUMBER 1 + RANDOM COUNT :DICT
OUTPUT ITEM :NUMBER :DICT
END

When I type the comand: write ["The adjective noun verb fs] I get the
following error message:

I don't know what to do with [INSERT RAND THING FIRST :TEMPLATE INSERT CHAR
32] in write

What am I doing wrong? I dont think that Mircoworlds Ex recognises the RAND
command.






  • Previous by thread: MIA, Ask an Expert
  • Next by thread: MIA, Ask an Expert

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008