Roshambo Code Challenge

Here's the Roshambo coding assignment.

If you want to pass the AWS Certification exams, you need to know a little bit of code. Not a lot, but you do need to know your way around web pages, Java files and modern data exchange formats like YAML and JSON.

  1. Drag from the left to the right to sort the scrambled Rock-Paper-Scissors code.
  2. When completed, copy the Roshambo HTML and JavaScript code into Notepad++.
  3. Save your HTML file as roshambo.html on your desktop.
  4. Open your roshambo.html file in Chrome and view your page in a web browser!
  5. You should lint your code when you get it to work.
JavaScript for AWS Exam
This simply page displays JSON data about yesterday's overall score.

WARNING: The dragging and dropping function doesn't work well on mobile.

Required Overview

There is a JSON file named yesterdays-totals, hosted on scrumtuous.com, that contains yesterday's totals from all visitors who played the rock-paper-scissors game.

Look at the file yourself and see if you can decipher the contents of this complicated JSON file:
http://www.scrumtuous.com/yesterdays-totals.json

Here's what it looks like:

{"wins":231,"losses":98,"ties":123}

JSON is the standard, data-exchange format for web pages, microservices and RESTful web services.

If we can figure out how to display the data in this JSON file in our webpage, then we can basically handle any type of data exchanges that happen over the modern web. What a delicious thought!

Now get to work!

The JSON Data

JSON for AWS Exam
JavaScript Object Notation (JSON) is the default data exchange format for the web. You'll need to know it to pass AWS Certification exams.
  • Unsorted
  • <html>
  • <body>
  • Losses: <span id="losses"></span> <br/>
  • Here is yesterday's score:<br/>
  • Ties: <span id="ties"></span> <br/>
  • Wins: <span id="wins"></span> <br/>
  • <head><title>Rock Paper JSON</title></head>

  • <script>
  • let ajaxRequest = new XMLHttpRequest();
  • if (this.readyState == 4 && this.status == 200) {
  • }
  • document.getElementById("losses").innerHTML = score.losses;
  • let url = "http://www.scrumtuous.com/yesterdays-totals.json"
  • ajaxRequest.onreadystatechange = function() {
  • console.log(this.responseText);
  • ajaxRequest.send();
  • let score = JSON.parse(this.responseText);
  • ajaxRequest.open("GET", url, true);
  • </body>
  • document.getElementById("wins").innerHTML = score.wins;
  • </script>
  • }; // end onreadystatechange
  • document.getElementById("ties").innerHTML = score.ties;
  • </html>
  • Sorted
  • Start the HTML page
  • Title and Stuff
  • Start the page content
  • Info to the user
  • Place to display the wins
  • Display something here
  • Display something else here

  • Begin Scripting
  • Declare the URL with the JSON data
  • Create an object to make a request
  • Use a GET invocation on the URL
  • Send the request!
  • Declare method to handle the response
  • Check for a good response
  • Log the JSON that we got
  • Convert JSON to score object
  • Update wins in the HTML
  • Update losses in the HTML
  • You know what to do next
  • End the if
  • End the method
  • End the script
  • You know what to do
  • Finish it off

All Answers Answered

Answers Remain

Practice Exam
AWS Practitioner Mock Exam Five

Here are some morepractice exam questions for the AWS Practitioner Cert. Want to get AWS Practitioner certified? Start here..

Practice Exam
AWS TCO and Design Principles Exam

This AWS practice exam will test you on Practitioner Exam objectives 1.2 and 1.3 on Cloud economics, TCO and architecture design patterns.

Practice Exam
AWS Cloud Concepts and Benefits Practice Exam

Here are 10 sample AWS Cloud Practitioner exam questions on objective 1.1, dealing with Cloud Concepts, AWS business value and the benefits of cloud computing.

Practice Exam
AWS Practitioner Mock Exam Two

AWS Practice Exam Two for people who want to pass the Amazon Practitioner Certification on the first try.

Practice Exam
AWS Practitioner Mock Exam Three

Here are some practice, AWS exam questions. Want to get AWS Practitioner certified? Start here.

Practice Exam
AWS Practitioner Mock Exam One

Want a challenge? Try out this mock AWS Exam practice test!

Practice Exam
AWS Practitioner Mock Exam Four

Here are some practice, AWS exam questions. Want to get AWS Practitioner certified? Start here..

Practice Exam
Some Mock AWS Exam Questions

I'm just testing out my ReactJS application. Want to give it a try? Then take this short mock exam.

Flashcards
The AWS Responsibility Model

These AWS practitioner exam flashcards test you on your knowledge of the AWS responsibility model. Whose responsibilty is cloud infrastructure, anyways?

Flashcards
AWS Cloud Responsibility Model Part II

This is the second drag-and-drop exercise that tests you on your understanding of Amazon's responsibility model for cloud computing.

Flashcards
OpEx versus CapEx Explained

A fun way to learn the difference between OpEx and CapEx for the AWS practioner exam.

Flashcards
TCO, Economics & Cloud Design Principles

Learn sections 1.2 & 1.3 of the AWS Practitioner Exam with these AWS Flashcards on cloud economics, AWS design principles.

Flashcards
The Benefits of Cloud Computing

These AWS flashcards test you on section 1.1 of the AWS practitioner exam, namely the AWS Cloud and its value proposition.