Giter VIP home page Giter VIP logo

-game-wdi-dc-2018's Introduction

Snapple Flash

-GAME-WDI-DC-2018, 07/13/18

By Lawrence Kirk

Description

This Application Helps the user practice there snapple fact's through checking out an array of exciting data. The user will also enjoy the added features that include background changes, a review button, and scoring funcitonality.

##Features

  • Application takes your score.
  • You can change up background styles.
  • Clicking on the cap will show you the facts.
  • You can review your incorrect answers and questions for a better round next time.

Setup/Installation Requirements

  • Clone this repository.
  • Open repository in your browser.
  • Click on the snapple cap or other information buttons.
  • Use added features like the review, change background, and scoring feature.

Known Bugs

There are no known bugs.

Support and contact details

Please email me for further questions at [email protected]

Technologies Used

HTML

CSS

JavaScript

Contribution Guidlines

Direct link to repository: https://github.com/lmkirkiii/-GAME-WDI-DC-2018

Specifications

  1. It can take a combination of values and add them together.
  • Example input: Large,Pepperoni
  • Example output: 18 Dollars

License

Copyright(c) 2015 Lawrence Kirk.

This software is licensed under MIT license.

-game-wdi-dc-2018's People

Contributors

lmkirkiii avatar

Watchers

James Cloos avatar

-game-wdi-dc-2018's Issues

Regarding Code Structure and OOP

Another student had a similar question, I wanted to share the same answer/response and see if it helps your understanding. It is basically related to how to keep your code dry, maintainable and the benefits of OOP.

Let me know if it helps.


If you wanted to make it more OO(object oriented) 

you could break up the project in to a few different classes.



event listeners

logical operations



you could include both of those in a ‘Utilities’ class, I use a utilities or a service class for things that are important, may need to be reused else where in my code base but are really just tools to help me accomplish a task.



generally you don’t want to nest more than 3 levels, I prefer not to go greater than 2 for if statements/loops and other control flow operations

you could also make the logical operations easier to read by abstracting them to a function and then passing the variable needed for the operation needs via an argument.

This is an example of “Tell Don’t Ask” (https://robots.thoughtbot.com/tell-dont-ask). Often “Ask” looks like an if statement if the logic goes one way or another the if statement will carry out whatever you want in your brackets, “Tell” calls a function in a class or module that has logic in it to do what was in the if statement. This structure is more maintainable, imagine if multiple things depend on the logic of that if statement or if that same if statement is reused throughout the code.

It is better to store it in one place instead of having that logic (if statement) spread throughout the code base.

Example #pseudocode:

//ASKING


if (person[‘don’] === ‘don’ && person[‘erin’] === ‘erin’) {

runPeopleFunction()

}




//OR




//Filename: Utilities.js

module.exports = {


function areThesePeople(person) {



if (person[‘don’] === ‘don’ && person[‘erin’] === ‘erin’) {

 runPeopleFunction()

 }



// a more succinct version of the if statement above a ternary operator

// return (person1[‘don’] === ‘don’ && person2[‘erin’] === ‘erin’) ? true : false
}



 function runPeopleFunction() {

console.log(‘these are people)

}




}









//Filename: index.js
//then you can use it with 


let Utilities = require(../classes/Utiities)

#TELLING
Utilities.areThesePeople(personObj)

this would not add a ton of value by itself (with this current example), imagine if you had a lot of logical operations (if statements) that you needed to use throughout your application.

This code pattern can be very helpful in cleaning up commonly used files. In the above situation the index.js is the commonly used files and the Utilities file would only be modified when you wanted to add new utilities. This abstraction will allow you to reuse logic/code and keep files (index.js) that are frequently used cleaner, less complex. 

if you find your self doing multiple if statements, one after another you may be in the position to combine if statements using ‘&&’ or ‘||’

 or you may want to abstract like in the pattern above.

Feedback

you could break up your js in to different files



you could stop hiding and showing elements and delete them or add them as needed.



good comments



you could add spaces between the function and the arguments, see line 154



I can tell that you worked hard and you were thinking through the problems you faced



for drying up your code look for duplication, put the duplication in to a function and then call the function.

Do this enough times and see if any of the functions have enough in common to put them in to a class or object.

the css validator isn’t up to date enough to know space-evenly, disregard it.

I think the review button and the functionality after clicking it could use a little work.


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.