Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Video Submit one video in .mp4, .wmv, .avi, or .mov format that demonstrates the running of at
least one significant feature of your program. Your video must not exceed 1 minute in length
and must not exceed 30MB in size
Prompt 2a. Provide a written response or audio narration in your video that:
● identifies the programming language;
● identifies the purpose of your program; and
● explains what the video illustrates.
(Must not exceed 150 words)
This project is a computerized version of “Rock, Paper, Scissors”, a practically timeless game
that is still played by the masses today, and was written in JavaScript. The purpose of this
program is to simulate the experience of the game either with a friend, or a computer. This
video illustrates 2 of the gamemodes featured in the project: Player versus Player mode, and
Player vs Computer mode. This program has the entire game simulated, ranging from your 3
choices, and to who gets eliminated, and to who wins after there is only 1 player left.
2b. Describe the incremental and iterative development process of your program, focusing on
two distinct points in that process. Describe the difficulties and / or opportunities you
encountered and how they were resolved or incorporated. In your description clearly indicate
whether the development described was collaborative or independent. At least one of these
points must refer to independent program development. (Must not exceed 200 words)
When starting the development, I first created all my setup screens: how many players, what
game mode, etc. When I was done with that, I would go on with creating the core of the game:
the countdown to the game, and the game itself. A problem I had while coding was my function,
whoWins(). Given how advanced it was, I had a problem where the function sometimes
wouldn’t meet the requirements I set it to have, largely due to syntax errors and other
functions. To fix this, I would constantly use the debug tool to find out what requirements are
not being met, and fix it in the code. Another problem I had is in the function, theGame, I was
unable to permanently change a variable called by a parameter. To fix this, I had to widen the
code to allow for multiple variables, instead of one condensed into a variable and function
parameter.
2c. Capture and paste a program code segment that implements an algorithm (marked with an
oval in section 3) and that is fundamental for your program to achieve its intended purpose.
This code segment must be an algorithm you developed individually on your own, must include
two or more algorithms, and must integrate mathematical and/or logical concepts. Describe
how each algorithm within your selected algorithm functions independently, as well as in
combination with others, to form a new algorithm that helps to achieve the intended purpose of
the program. (Must not exceed 200 words)
Code Segment
Written Response
The main algorithm, function theGame(), is arguably the main function of the entire program.
This algorithm is in charge of maintaining the running game all the way until the game ends,
and once the game starts again, the algorithm comes into effect once again. It is a prominent
feature in both gamemodes, Player vs Computer, and Player vs Player. Within it, there is a
sub-algorithm that is in charge of sorting through the choices that each player makes in the
game, and assigns it to them, featured on lines 5-9. This algorithm does it independently. The
second sub-algorithm, featured on lines 22-26, let the players see what choices their peers made,
and eliminate the players who lost based on another function, called WhoWins(). This
sub-algorithm was also made independently. These sub-algorithms, along with the rest of the
algorithms, make up the progression of the game and how you can keep moving forward until
there is only 1 player left. Without either of the sub-algorithms, absolutely nothing would be
moved forward. The user would be stuck on this function and would never move forward to
the next function, theGame().
2d. Capture and paste a program code segment that contains an abstraction you developed
individually on your own (marked with a rectangle in section 3). This abstraction must
integrate mathematical and logical concepts. Explain how your abstraction helped manage the
complexity of your program. (Must not exceed 200 words)
Code Segment
Written Response
This abstraction managed the interactions between each player and the choices they made.
When everyone has made their choice, choosing Rock, Paper, or Scissors, either someone beats
one person, or they don’t. They also have a set player they must take out before being able to
eliminate anyone else. This abstraction manages the complexity of this entire process, limiting
it down from 200+ lines of code(from previous versions of the code) to a mere 44 lines.
Export or save this document as a PDF and turn in to the AP Digital Portfolio along with your
Video and Program Code (separate files).