Code Monkey home page Code Monkey logo

triviagameproject's People

Contributors

busenah avatar

triviagameproject's Issues

needs to be names `index.html`

The way Github Pages deployment works, it does not recognize trivia.html and so it only shows your readme In your deployed app

By convention, you want to call the core HTML file for your site index.html, and breaking away from that convention does cause a serious issue in this case

Only the first question?

TriviaGameProject/trivia.js

Lines 129 to 136 in 52f5311

for (var i = 0; i < options.q1.length; i++) {
var myOption = document.createElement("div");
myOption.innerHTML = options.q1[i];
console.log(myOption);
var myOptions = document.querySelector(".options");
myOptions.appendChild(myOption);
console.log(myOptions);
}

It is hard to tell since I can't see the deployed app, but looking at your code I would expect that it works for the first question but then does not have a way to show the subsequent questions. If in your app you notice that bug, take a look at how you are using the arrays and how you are rendering information to the DOM

Refactor: do not need an `answer` array at all

TriviaGameProject/trivia.js

Lines 138 to 189 in 52f5311

let answers = {
q1: "Montgomery",
q2: "Juneau",
q3: "Phoenix",
q4: "Little Rock",
q5: "Sacramento",
q6: "Denver",
q7: "Hartford",
q8: "Dover",
q9: "Tallahassee",
q10: "Atlanta",
q11: "Honolulu",
q12: "Boise",
q13: "Springfield",
q14: "Indianapolis",
q15: "Des Moines",
q16: "Topeka",
q17: "Frankfort",
q18: "Baton Rouge",
q19: "Augusta",
q20: "Annapolis",
q21: "Boston",
q22: "Lansing",
q23: "Saint Paul",
q24: "Jackson",
q25: "Jefferson City",
q26: "Helena",
q27: "Lincoln",
q28: "Carson City",
q29: "Concord",
q30: "Trenton",
q31: "Santa Fe",
q32: "Albany",
q33: "Raleigh",
q34: "Bismarck",
q35: "Columbus",
q36: "Oklahoma City",
q37: "Salem",
q38: "Harrisburg",
q39: "Providence",
q40: "Columbia",
q41: "Pierre",
q42: "Nashville",
q43: "Austin",
q44: "Salt Lake City",
q45: "Montpelie",
q46: "Richmond",
q47: "Olympia",
q48: "Charleston",
q49: "Madison",
q50: "Cheyenne"
};

Because the statesAndTheirCapitals array already has the capitals of each state, this new array of just the answers adds a level of complexity to the app without any benefit that I can see. Since the property exists, and you are already using the statesAndTheirCapitals array, you can and should use the capital property for each state.

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.