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 a text editor.
  3. Save your HTML file as roshambo.html in a folder on your desktop named rps.
  4. Open your roshambo.html file in Chrome and view your page in a web browser!
  5. Create a file named Dockerfile (no extension) in the same rps folder as roshambo.html
  6. Run the Docker commands from that folder
JavaScript for AWS Exam
Here's what the HTML, JavaScript and 'styled' Roshambo example will look like when finished.

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

  • Scrambled
  • <!DOCTYPE html>
  • .feedback {color: red; margin: 50px;}
  • <head>
  • <meta charset="utf-8">
  • <html>
  • <style>
  • <a href="#" onclick="playRoshambo('rock')"> rock </a> &nbsp;
  • <a href="#" onclick="playRoshambo('scissors')"> scissors </a> &nbsp;
  • .highlighted {border: 2px red solid}
  • </head>
  • p { font-family: verdana; }
  • <title>Rock Paper Roshambo</title>
  • <body class="highlighted">
  • <p>Which one will it be?</p>
  • </style>
  • <a href="#" onclick="playRoshambo('paper')"> paper </a> &nbsp;
  • <div id="results" class="feedback"></div>
  • body { color:navy; margin: 25px;}

  • } // end rock if
  • <script>
  • } // end paper if
  • </html>
  • result = "tie"
  • } // end method
  • } // end scissors if
  • if (clientGesture=='paper') {
  • </body>
  • if (clientGesture=='scissors') {
  • document.getElementById('results').innerHTML = result;
  • result = "win"
  • </script>
  • if (clientGesture=='rock') {
  • playRoshambo = function(clientGesture) {
  • result = "lose"

  • docker build -t nginxuous .
  • docker push scrumtuous/nginxrps:v1
  • docker tag nginxuous scrumtuous/nginxrps:v1
  • docker run --name engine1 -p 80:80 -d nginx
  • FROM nginx
    COPY roshambo.html /usr/share/nginx/html
  • docker run --name rps02 -p 99:80 -d nginxuous
  • http://localhost:88
  • docker run --name rps01 -p 66:80 -d nginxuous
  • docker login -u scrumtuous -p password
  • docker stop engine1
  • docker run --name engine2 -p 88:80 -d nginx

  • Try This After the Drag and Drop
  • git clone https://github.com/scrumtuous/numberguesser.git
  • cd numberguesser
  • docker build -t tomcatuous .
  • docker run --name monolith -p 8085:8080 -d tomcatuous
  • http://localhost:8085/numberguesser/playthegame

  • docker-compose.yml
  • YAML files are indented with two spaces
  • version: '3.7'
  • services:
  • ng:
  • image: nginxuous
  • ports:
  • - 8082:8080
  • tc:
  • image: tomcatuous
  • ports:
  • - 82:80
  • run it with: docker-compose up
  • Sorted
  • Declare the document type
  • Start your html
  • Put something here
  • Page encoding
  • Page title
  • Put something here
  • Make all body text navy blue
  • Change paragraph font family
  • Put something here
  • Highlight with a red border
  • Put something here
  • End head
  • Put something here
  • Prompt the user
  • rock link
  • Put something here
  • anchor tag
  • Display results

  • start the script
  • declare the method
  • client picks rock
  • it's a tie
  • end rock if
  • client picks paper
  • You're a potato!
  • Put something here
  • Put something here
  • Put something here
  • Put something here
  • Dynamically update the HTML
  • Put something here
  • Close the script tag
  • Almost done!
  • HTML DONE!

  • Login to DockerHub
  • Run nginx on port Antropov
  • Run nginx on port Lindros
  • View nginx in the browser
  • Contents to go into Dockerfile
  • Build your own Docker image (dot!)
  • Run your Docker image like it was Mario Lemieux
  • Run your Docker image like it was Wayne Gretzky
  • Tag your image with your Docker username
  • Push your personal image to your DockerHub account
  • Stop a docker container

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.