GithubHelp home page GithubHelp logo

marinacod / intro-to-programming-section-5 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from code-the-dream-school/intro-to-programming-section-5

0.0 0.0 0.0 1.57 MB

JavaScript 64.48% CSS 4.47% HTML 31.05%

intro-to-programming-section-5's Introduction

Lesson 5.1: Debugging JavaScript in the Browser

This assignment will teach you the following:

  • What is Debugging?
  • Breaking on Events and Basic Stepping
  • Basic and Conditional Line Breakpoints
  • Debugging Functions
  • Debugging Exception Errors
  • Breaking on DOM Changes and Watch Expressions

Instructions

Getting Started:

Fork this GitHub repository to create your own working version:

Fork Assignment: Step 1

Select your GitHub account from the list:

Fork Assignment: Step 2

You should be directed to your forked GitHub repository:

Fork Assignment: Step 3

Click the "Code" button and copy the URL for your repository:

Fork Assignment: Step 4

Clone this repository so that the code is available on your local machine:

Hint: Run this command from the directory where you want to store your code

Note: Replace <url> with the URL you copied in the previous step

git clone <url>

Navigate to the directory you just cloned in your terminal:

cd intro-to-programming-section-5

Create a new local branch to work on separate from the main branch:

git checkout -b lesson-5-1

Now, open the project directory in your code editor and continue to the next section.

Task List:

The goal of this assignment is not to create a working application, but to practice debugging JavaScript using the browser developer tools. You should focus less on getting all the "right" answers and more on the process of troubleshooting each issue.

There are at least 8 bugs in this assignment, do your best to track down and fix as many as you can.

Below is a list of requirements explaining what the application should do:

  • No errors in the browser console

Note: keep the console open as you play the game so that you can see the randomly generated "target number"

Game Play: Step 1

  • At the start, the "reset" button and all of the "messages" should be hidden

Game Play: Step 2

  • You should be able to type a number into the input field and click "Submit Guess" to submit the form

Game Play: Step 3

  • When the form is submitted, you should see the following:

    • A message displaying the number that was entered
    • A message displaying how many tries you have left (starts at 5 and decrements by 1)
    • A message describing the guess (low, high, etc.)
    • A "reset" button that restarts the game
  • If the guessed number is BELOW the target, the message should say "too low"

Game Play: Step 4

  • If the guessed number is ABOVE the target, the message should say "too high"

Game Play: Step 5

  • If the guessed number is the SAME as the target, then:
    • The input field and "Submit Guess" button should be disabled
    • The message should say "guessed correctly"

Game Play: Step 6a

  • If the guessed number is not the same AND all 5 tries have been used, then:
    • The input field and "Submit Guess" button should be disabled
    • The message should say "0 guesses remaining"

Game Play: Step 6b

  • When you click the "reset" button, the form should return to its initial state (not disabled)

Game Play: Step Reset

Stretch Goals:

These items are not necessarily bugs in the code, but rather, missing features that should exist to prevent unexpected behavior.

(Optional) Complete the following:

  • You should not be able to submit a guessed number lower than 1

Game Play: Step 7

  • You should not be able to submit a guessed number higher than 99

Game Play: Step 8

  • If there is only one guess left, it should say "guess" (singular) instead of "guesses" (plural)

Game Play: Step 9

Final Step:

Check the status of your local repository to double-check the changes you made:

git status

Stage the file(s) that you edited:

git add .

Check the status again and notice that the changes from before are now staged:

git status

Create a commit for the changes you made and add a message describing the changes you made:

Note: Replace <message> with your message

git commit -m "<message>"

Push your commit to the remote repository (visible in GitHub):

git push

Check the log to make sure your commit has been published:

git log --oneline

Create a pull request and submit:

View instructions


Created by Code the Dream

intro-to-programming-section-5's People

Contributors

mamooredesigns avatar ethomp-dev avatar jsiirila-sfx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.