首页 > > 详细

代写Monster High、辅导 Step

Assignment 2: Step
Monster High
Introduction
In this assignment, we’ll write Step code to select and execute content units. Our content units are plot
points for a soap opera world called Monster High. In this world, students, who also happen to be
monsters, engage in conflicts and romance.
The provided code sets up the framework for the assignment. You’ll be adding code to two of the files,
Queries.step and PlotPoints.step, as well as potentially changing the initial state of the world in
Students.step to test your code.
This code works by testing the state of the world to see which plot points are potentially applicable and
then picking one to execute. Two entry points have been provided for testing the code. The task
[Events] selects and executes six random plot points. The task [ShowPlotPointMenu] shows a
menu of all the plot points available in the current story state. The user can select one, it executes, and a
menu of plot points available in the new state is displayed. Plot points will be represented as tuples, so if
you haven’t done the reading on tuples, do that now.
For example, we might represent the plot point that Jayden confesses their love to Tiana with the tuple:
[confess_love jayden tiana]. However, this only makes sense if we know that Jayden has a
crush on Tiana, otherwise, why would they confess? And it doesn’t make sense if the two are already
dating. So you need to make sure that the confess_love plot point is only available when there’s an
attraction that isn’t being acted on. When this plot point executes, it might be printed as “Jayden
confesses their love to Tiana”. Additionally, when the plot point executes, it changes the
state of the world so that Tiana now knows that Jayden as a crush on Tiana: Knows Tiana [CrushOn
Jayden Tiana]. Here we’re also using tuples to represent what it is Tiana knows.
We’re using fluents to represent the changing state of the world as plot points execute. Read more
about fluents in tutorial 8.
Note also that we’ve provided you with a version of Mention that understands things like pronoun
generation and capitalization of character names. You don’t need to do anything with it, just realize that
it’s there. If you don’t know what Mention is, read part 6 of the tutorial on generating text in context.
Getting started
To begin with, drag the Monster High folder into the Documents/Step folder on your machine (the Step
folder inside your Documents folder). Then, open the Monster High folder you just put inside the Step
folder in Visual Studio Code.
Replace the earlier version of Step that you downloaded with the new version provided in the
assignment zip archive. This new version of Step fixes a bug that affects the assignment.
Finally, start Step, and type “project Monster High”.
Optional: Making a student body
The file Students.step defines the student body, including what type of monster each student is,
what clubs people are in, and who has crushes, is dating, and are friends. For the purposes of testing
your code, you may want to create your own student body with a specific initial state. However, you
don’t need to do this if you don’t want to.
Note that the Mention code we gave you will use they as the pronoun for all characters by default. If
you prefer, you may optionally specify preferred pronouns for some or all of your characters. To do
that, just add statements to your Students.step file of the form:
PreferredPronoun student pronoun.
Where student is the student you’re specifying a pronoun for, and pronoun is either he or she. You can
specify they, but since that’s the default anyway, there’s no particular point in doing so. Anyone you
don’t specify a pronoun for will be referred to using they.
Part one: Queries
The file Queries.Step defines predicate rules to infer interesting relations in the story world.
Examples include:
UnrequitedLove ( a is crushing b , but not vice versa) and,
CheatingOn cheater cheatee ( cheater is dating cheatee and is also dating someone else).
Write predicate rules for each of the predicates specified in Queries.Step.
Part two: Plot Points
Where:
• eventType is the kind of event (e.g. confess_love, star_crossed_lovers, etc.)
• other-information is the other information that appears in that kind of event: definitely the
characters participating in it, but for some of them, there are things like the monster types or
clubs the students belong to
• condition is the information to determine whether this plot point is allowed in the current state
of the story world.
Here’s an example. For the breakup plot point, it only makes sense for it to happen if the characters are
already dating and have had a fight. So the rule for that would look like:
Will generate:
I like Jayden. They read books.
If Jayden’s preferred pronoun is they, but:
I like Jayden. He reads books.
If Jayden’s preferred pronoun is he.
The magic [s] task only works for regular verbs. If you want to handle a different verb, then grab the
code for Is from Mention.step and just change it for your verb.
Part four: Invent some more plot points
Now write PlotPoint and ExecutePlotPoint methods for two more kinds of plot points. They can
be anything of your choosing, although they need to depend on the story world. Feel free to add new
information to the story world if you like.
Some ideas:
• Two characters have a heart-to-heart discussion while at their club. This would obviously only
make sense when they’re in the same club.
• Two characters become friends after a fight. For that, there’d need to be a reason for them to
have the fight. And they probably shouldn’t be dating, since people who are dating should
probably already be friends. Maybe they become friends because they have a shared friend.
• A werewolf character does something on the full moon
• A vampire character bites a human character
Turning it in
Save all your files, reload (control-R) to make sure everything really does load. Assuming everything
seems okay, make a zip file of your Monster High directory and upload it to canvas.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!