if ( $rand(1;100)$ == 3) then {
do this if the number 3 came up in a random 1/100
}
if ( $rand(1;100)$ <= 35) and ( $rand(1;100)$ <= 65) then {
do this if the random number generator produces a number between 1 and 35 AND a number between 1 and 65
}
if ( $rand(1;100)$ <= 35) and ( $rand(1;100)$ <= 65) then {
do this if the random number generator produces a number between 1 and 35 AND a number between 1 and 65
} set num <var1; $rand(1:100)$>
if ( %var1% < 35 ) then {
msg <Below 35>
}
else {
if ( %var1% >= 35 ) then {
msg <Larger than 35>
}
}' "The Monster Program: An Experiement in AI"
' Created with QDK Pro 3.12
define game <The Monster Program: An Experiement in AI>
asl-version <311>
start <The Laboratory>
game author <J.M.Francia>
game version <1.0>
game copyright <J.M.Francia>
game info <-Created with QDK Pro 3.12|n-Special thanks to:|nMy parents for funding and support |nMr. "Shweabizzle" for... uh... grading it>
command <Instructions> msg <Try typing 'Help'>
command <Help> msg <To give the creature an object, type 'give *object*', such as 'give apple', 'give ball', or 'give bow and arrow'. Once the creature reacts to the object, a pop-up menu will show, asking you what to do to the creature. If you choose 'Give Treat', the creature will be rewarded with a treat, and will be much encouraged to react that way again in the future. If you choose 'Pet', he'll be moderatly encouraged to react that way again in the future. If you choose 'Ignore', he won't be encouraged to do anything in particular. If you choose 'Slap', he'll be moderatly discouraged to react that way in the future. If you choose 'Beat', he'll be very discouraged to react that way in the future. Simple, ain't it? Type in 'Credits' for credits of the program's production and design, and type 'quit' to exit the program. >
define variable <1VintelligentX>
type numeric
value <5>
end define
define variable <1IntelligentX>
type numeric
value <20>
end define
define variable <1Unintelligent1x>
type numeric
value <55>
end define
define variable <1Unintelligent2X>
type numeric
value <90>
end define
define variable <Punnishment>
type numeric
value <0>
end define
define variable <Reaction>
type numeric
value <!>
end define
end define
define synonyms
end define
define room <The Laboratory>
look <This is where the experiment will take place. The monster, fondly nicknamed "Toey", stands before you, with an obvious urge to learn. On your desk lays three objects: An apple, A ball, and a bow and arrow. To give one to him, simply type give 'object'. Such as give apple or give bow and arrow.>
define object <Apple>
prefix <An>
displaytype <Object>
article <it>
gender <it>
end define
define object <Ball>
prefix <a>
suffix <\>
displaytype <Object>
article <it>
gender <it>
end define
define object <Bow and Arrow>
prefix <A>
displaytype <Object>
article <it>
gender <it>
end define
end define
define procedure <Applereactioncheck>
if ( $rand(1;100)$ <= $Punnishment$ ) then msg <He's too afraid to do anything due to fear of punnishment.Try again.>
if ( $rand(1;100)$ <= $1VintelligentX$ ) then {
msg <He takes the apple, looking it over momentarily, before taking a knife and cutting it evenly into peices, eating each neatly and individually.|n|nReaction= Very Intelligent>
timeron <Punnishment Menu>
set numeric <Reaction; 0>
}
if ( $rand(1;100)$ > $1Vintelligentx$ ) and ( $rand(1;100)$ <= $1ntelligentx1 ) then {
msg <He takes the apple, sniffs it, then takes a bite.|n|nReaction = Intelligent.>
timeron <Punnishment Menu>
set numeric <Reaction; 1>
}
if is <$rand(1;100)$; gt; $1intelligentx$> and ( $rand(1;100)$ <= $1unintelligent1x$ ) then {
msg <He sniffs the apple, then for one reason or another, begins to rub it against his body. How strange.|n|nReaction= Not very intelligent>
timeron <Punnishment Menu>
set numeric <Reaction; 2>
}
if ( $rand(1;100)$ > $1unintelligent1x$ ) and ( $rand(1;100)$ <= $1unintelligent2x$ ) then {
msg <He takes the apple, looks at it for a bit. Then he looks at you. Then back to the apple. Then at you. With a swift motion, the apple is ricocheted off of your head. |n|nReaction = Not very intelligent>
timeron <Punnishment Menu>
set numeric <Reaction; 3>
}
if ( $rand(1;100)$ > $1unintelligent2x% ) then {
msg <He takes the apple fondly, before, with barely a moment's hesitation, he baps it against his own forehead. Again. And again. And again. He continues to repeat this neurotic act for no apparent reason whatsoever, apple bits flying about.|n|nReaction = Very unintelligent>
timeron <Punnishment Menu>
set numeric <Reaction; 4>
}
end define
define function <Applegive>
{
msg <You give Toey an apple.>
do <Applereactioncheck>
}
end define
define timer <Punnishment Menu>
interval <4>
action choose <Punishment menu>
disabled
end define
define text <intro>
Welcome, ladies and gents, to J.M.Francia's experiment in Artificial Intelligence. It's quite simple: There is a hypothetical creature before you, who will react differently to different objects that are given to him. Once he interacts with the object, you may praise or punnish him to encourage or discourage behavior. If he reacts by interacting the way in which you praised him, then he is actively learning, and the program is a success. Let's begin.
end define
define text <win>
end define
define text <lose>
end define
define selection <Punishment menu>
info <How do you wish to react?>
choice <Give him a treat> {
msg <He giggles with glee as you give him the tastey morsel. >
if ( Reaction = 0 ) then set numeric <Vintelligentx; $Vintelligentx$ + 10>
}
choice <Pet him>
choice <Ignore him>
choice <Slap him>
choice <Beat him>
end defineif ( $rand(1;100)$ <= $Punnishment$ ) then msg <He's too afraid to do anything due to fear of punnishment.Try again.>
if < $rand(1;100)$ <= $Punnishment$ > then msg <He's too afraid to do anything due to fear of punnishment.Try again.>
Ste wrote:problem is...(well, atleast i THINK this is a problem), you are using....if ( $rand(1;100)$ <= $Punnishment$ ) then msg <He's too afraid to do anything due to fear of punnishment.Try again.>
instead of....if < $rand(1;100)$ <= $Punnishment$ > then msg <He's too afraid to do anything due to fear of punnishment.Try again.>
in some of the script. i dont think you're supposed to use )'s and ('s for the tags.
' "The Monster Program: An Experiement in AI"
' Created with QDK Pro 3.12
define game <The Monster Program: An Experiement in AI>
asl-version <311>
start <The Laboratory>
game author <J.M.Francia>
game version <1.0>
game copyright <J.M.Francia>
game info <-Created with QDK Pro 3.12|n-Special thanks to:|nMy parents for funding and support |nMr. "Shweabizzle" for... uh... grading it>
command <Instructions> msg <Try typing 'Help'>
command <Help> msg <To give the creature an object, type 'give *object*', such as 'give apple', 'give ball', or 'give bow and arrow'. Once the creature reacts to the object, a pop-up menu will show, asking you what to do to the creature. If you choose 'Give Treat', the creature will be rewarded with a treat, and will be much encouraged to react that way again in the future. If you choose 'Pet', he'll be moderatly encouraged to react that way again in the future. If you choose 'Ignore', he won't be encouraged to do anything in particular. If you choose 'Slap', he'll be moderatly discouraged to react that way in the future. If you choose 'Beat', he'll be very discouraged to react that way in the future. Simple, ain't it? Type in 'Credits' for credits of the program's production and design, and type 'quit' to exit the program. >
define variable <1VintelligentX>
type numeric
value <5>
end define
define variable <1IntelligentX>
type numeric
value <20>
end define
define variable <1Unintelligent1x>
type numeric
value <55>
end define
define variable <1Unintelligent2X>
type numeric
value <90>
end define
define variable <Punishment>
type numeric
value <0>
end define
define variable <Reaction>
type numeric
value <0>
end define
end define
define synonyms
end define
define room <The Laboratory>
look <This is where the experiment will take place. The monster, fondly nicknamed "Toey", stands before you, with an obvious urge to learn. On your desk lays three objects: An apple, A ball, and a bow and arrow. To give one to him, simply type give 'object'. Such as give apple or give bow and arrow.>
define object <Apple>
prefix <An>
displaytype <Object>
article <it>
gender <it>
end define
define object <Ball>
prefix <a>
suffix <\>
displaytype <Object>
article <it>
gender <it>
end define
define object <Bow and Arrow>
prefix <A>
displaytype <Object>
article <it>
gender <it>
end define
end define
define procedure <Applereactioncheck>
if ( $rand(1;100)$ <= %Punishment% ) then msg <He's too afraid to do anything due to fear of punishment.Try again.>
if ( $rand(1;100)$ <= %1VintelligentX% ) then {
msg <He takes the apple, looking it over momentarily, before taking a knife and cutting it evenly into peices, eating each neatly and individually.|n|nReaction= Very Intelligent>
timeron <Punishment Menu>
set numeric <Reaction; 0>
}
if ( $rand(1;100)$ > %1Vintelligentx% ) and ( $rand(1;100)$ <= %1ntelligentx1% ) then {
msg <He takes the apple, sniffs it, then takes a bite.|n|nReaction = Intelligent.>
timeron <Punishment Menu>
set numeric <Reaction; 1>
}
if is <$rand(1;100)$; gt; %1intelligentx%> and ( $rand(1;100)$ <= %1unintelligent1x% ) then {
msg <He sniffs the apple, then for one reason or another, begins to rub it against his body. How strange.|n|nReaction= Not very intelligent>
timeron <Punishment Menu>
set numeric <Reaction; 2>
}
if ( $rand(1;100)$ > %1unintelligent1x% ) and ( $rand(1;100)$ <= %1unintelligent2x% ) then {
msg <He takes the apple, looks at it for a bit. Then he looks at you. Then back to the apple. Then at you. With a swift motion, the apple is ricocheted off of your head. |n|nReaction = Not very intelligent>
timeron <Punishment Menu>
set numeric <Reaction; 3>
}
if ( $rand(1;100)$ > %1unintelligent2x% ) then {
msg <He takes the apple fondly, before, with barely a moment's hesitation, he baps it against his own forehead. Again. And again. And again. He continues to repeat this neurotic act for no apparent reason whatsoever, apple bits flying about.|n|nReaction = Very unintelligent>
timeron <Punishment Menu>
set numeric <Reaction; 4>
}
end define
define procedure <Applegive>
msg <You give Toey an apple.>
do <Applereactioncheck>
end define
define timer <Punishment Menu>
interval <4>
action choose <Punishment menu>
disabled
end define
define text <intro>
Welcome, ladies and gents, to J.M.Francia's experiment in Artificial Intelligence. It's quite simple: There is a hypothetical creature before you, who will react differently to different objects that are given to him. Once he interacts with the object, you may praise or punnish him to encourage or discourage behavior. If he reacts by interacting the way in which you praised him, then he is actively learning, and the program is a success. Let's begin.
end define
define text <win>
end define
define text <lose>
end define
define procedure <givetreat>
msg <He giggles with glee as you give him the tastey morsel. >
if ( Reaction = 0 ) then set numeric <Vintelligentx; $Vintelligentx$ + 10>
end define
define selection <Punishment menu>
info <How do you wish to react?>
choice <Give him a treat> do <givetreat>
choice <Pet him>
choice <Ignore him>
choice <Slap him>
choice <Beat him>
end define
if is <$rand(1;100)$; gt; %1intelligentx%> and ( $rand(1;100)$ <= %1unintelligent1x% ) then {
msg <He sniffs the apple, then for one reason or another, begins to rub it against his body. How strange.|n|nReaction= Not very intelligent>
timeron <Punishment Menu>
set numeric <Reaction; 2>
}
S1aY3R wrote:
Also, Ste, what the $&@!# advice are you trying to give? You use ( ) NOT < > for IF statements. If you used <> an error would be given and Quest would crash.
Obviously Ste doesn't know half as much as he thinks he does.
define procedure <givetreat>
msg <He giggles with glee as you give him the tastey morsel. >
if ( Reaction = 0 ) then set numeric <Vintelligentx; $Vintelligentx$ + 10>
end define
define procedure <givetreat>
msg <He giggles with glee as you give him the tastey morsel. >
if ( Reaction = 0 ) then set numeric <Vintelligentx; %Vintelligentx% + 10>
end define