{ “Hints” : [
[ {
“Title” : “How do I worb the frob?”,
“Hint” : [ “Does the frob want to be worbed?”,
“Do you have a worbing tool?”,
“Is your worb icon zammified?”
]
} ],
[ {
“Title” : “How do I worb the frob?”,
“Hint” : [ “Does the frob want to be worbed?”,
“Do you have a worbing tool?”,
“Is your worb icon zammified?”
]
} ]
] }
]
To write the active hints:
select the hint channel;
say “{ ‘hints’: [”;
repeat with N running from 1 to the number of rows in Table of Active Hints
begin;
choose row N in Table of Active Hints;
say "[{ ‘title’: ‘[title entry]’, ";
let hint-table be table entry;
say “‘hint’: [”;
repeat with N running from 1 to the number of rows in hint-table
begin;
choose row N in hint-table;
say “’[hint entry]’”
if N is less than the number of rows in hint-table, say “,”;
end repeat;
say “]}]”;
if N is less than the number of rows in the Table of Active Hints, say “,”;
end repeat;
say “] }”;
select the main channel.
[/code]
{ "Hints" : [
[ {
"Title" : "How do I worb the frob?",
"Hint" : [ "Does the frob want to be worbed?",
"Do you have a worbing tool?",
"Is your worb icon zammified?"
]
} ],
[ {
"Title" : "How do I worb the frob?",
"Hint" : [ "Does the frob want to be worbed?",
"Do you have a worbing tool?",
"Is your worb icon zammified?"
]
} ]
] }
]
To write the active hints:
select the hint channel;
say "{ 'hints': [bracket]";
repeat with N running from 1 to the number of filled rows in Table of Active Hints
begin;
choose row N in Table of Active Hints;
if there is a title entry
begin;
say "[bracket]{ 'title': '[title entry]', ";
let hint-table be subtable entry;
say "'hint': [bracket]";
repeat with O running from 1 to the number of rows in hint-table
begin;
choose row O in hint-table;
say "'[hint entry]'";
if O is less than the number of rows in hint-table, say ",";
end repeat;
say "[close bracket]}[close bracket]";
if N is less than the number of filled rows in the Table of Active Hints, say ",";
end if;
end repeat;
say "[close bracket] }";
select the main channel.