xxxxxxxxxx
156
let outputP;
let outputP01;
let outputP02;
function setup() {
noCanvas();
background(255);
textAlign(LEFT, TOP);
textSize(24);
output = createP("Read Carefully the text below, and answer questions.")
outputP01 = createP(" ");
}
function draw() {
}
function keyPressed() {
mousePressed();
}
function mousePressed() {
var grammar01 = tracery.createGrammar(grammarSource01);
grammar01.addModifiers(tracery.baseEngModifiers);
var output01 = grammar01.flatten("#origin#");
outputP01.html(output01);
}
// cut and paste your grammar below (as the value for variable "grammarSource")
var grammarSource01 =
{
"origin": "#[name:#common chinese name#][agesmall:#agenumbersmall#][agebig:#agenumberbig#][nurse:#protector#][lion:#monster#][value:#social core value#]story#",
"story":"<center><h2>Cautionary Tales for Chinese</h2><h4>Designed for the Admonition of Chinese between the ages<br/>of #agesmall# and #agebig# </h4><p></p><h3><i>#name#</i>,</h3><h4>Who ran away from his #nurse#, and was eaten by #lion.a#.</h4><p></p>#intro##second# #third# #fourth# #fifth# #sixth#</center> ",
"agenumbersmall" :[
"one", "two","three","four","five","six","seven","eight","nine","ten"
],
"agenumberbig" :[
"fifty-and-two-days",
"sixty-five",
"eighty-eight",
"forty-nine",
"fifty-two",
"sixty-four and two months",
"one month before eighty",
"somewhere around seventy",
"right before death"
],
"common chinese name":[
"Zhang Wei",
"Wang Wei",
"Wang Fang",
"Li Wei",
"Wang Xiuying",
"Li Xiuying",
"Li Na",
"Zhang Min",
"Zhang Zixuan",
"Li Haoran",
"Wang Haoran",
"Chen Haoran",
"Zhang Jiaxuan",
"Wang Jiaxuan",
"Wang Zihan",
"Li Zihan",
"Zhang Zihan"
],
"protector":[
"government jobs",
"Social insurance fund",
"family get-together",
"belief in socialism with Chinese characteristics",
"real estate loan",
"duty to get married",
"duty for two kids"
],
"monster":[
"Hollywood movie",
"Korean soap opera",
"Japanese anime",
"LGBT group",
"DINK couple",
"K-pop star",
"McDonald's Mac N Cheese",
"book about capitalism",
"luxury bag"
],
"food":[
"Yi Dian Dian milk tea",
"HEYTEA milk tea",
"Chinese spicy crayfish",
"spicy hot pot",
"a cat",
"wifi",
"free shipping in Alibaba",
"Weibo",
"anti-Japan dramas",
"Wechat red pocket"
],
"social core value": [
"prosperity and democracy",
"civility and harmony",
"freedom and equality",
"justice and the rule of law",
"patriotism and dedication",
"integrity and friendship"
],
"intro": ["<p>There was a Boy whose name was #name#,<br/> his friends were very good to him.<br/>They gave him #food#, #food#, and #food#,<br/>and read him stories through and through.<br/>But there it was the dreadful fate befell him, which I now relate.</p>" ],
"second":[
"<p>You know—at least you ought to know. <br/>For I have often told you so — <br/>That Chinese people never are allowed to leave their #nurse# in a crowd;<br/>Now this was #name#’s especial Foible, <br/>he ran away when he was able,<br/>And on this inauspicious day,<br/>he slipped his hand and ran away!<br/>He hadn’t gone a yard when— <br/>With open Jaws, #lion.a# sprang,<br/>and hungrily began to eat the Boy - beginning at his feet,<br/>Now just imagine how it feels:When first your toes and then your heels,<br/>and then by gradual degrees <br/> your shins and ankles, calves and knees,<br/>are slowly eaten, bit by bit.</p>"
],
"third":["<p>No wonder #name# detested it!<br/>No wonder that he shouted “<b><i>#value#</i></b>” <br/>The #nurse# heard his cry, <br/>almost ran to help the little gentleman.<br/>“<b><i>#value#</i></b>!” <br/>he ordered as he came, <br/>“<b><i>#value#</i></b>!” <br/>he cried, with angry Frown</p>"],
"fourth":["<p>The #lion# made a sudden stop,<br/>He let the dainty morsel drop,<br/> and slunk reluctant to his cage,<br/>snarling with disappointed rage,<br/>But when the #lion# bent him over #name#,<br/>The eyes of #nurse# were dim. </p>"],
"fifth":["<p>The Lion having reached his head.<br/>The Miserable #name# was dead!</p>"],
"sixth":["<p>When #nurse# informed his Parents,<br/> they were more concerned than I can say: <br/>His Mother, as She dried her eyes, said, <br/>“Well—it gives me no surprise,<br/>He would not do as he was told!”<br/>His Father, who was self-controlled,<br/>bade all the children round attend <br/>to #name#'s miserable end, <br/>And always keep a-hold of #nurse#,<br/>for fear of finding something worse.</p>"]
}