Git Product home page Git Product logo

compliment-generator's Introduction

Compliment Generator

Can't ever think of a compliment on the fly?? Well today you are tasked with creating a random compliment application to "burn" your friends on the spot :)

Objective

Use your knowledge of arrays, and functions to generate random compliment instantly.

Prerequesites

  • Bascic knowledge of functions
  • Basic knowledge of arrays
  • Knowledge of Math.floor && Math.random

Requirements

  • Sublime Text
  • A create mind

Upon completing this project, students should understand:

  • Functions
  • Arrays
  • Calling functions within functions
  • Using javascript Math methods

Get started:

  • Fork and Clone this repository
  • Create the following files: compliment.js
  • Follow the directions below carefully. Remember to be committing.

Part 1: Create a random word function

  • Create a function called pickRandomWord that takes one parameter (word). This function should return a random word using Math.floor and Math.random.
  • Test your function by invoking it and passing through an array of words. Run your file with node compliment.js. Make sure to console.log() in your function. If written correctly your function should return a random word from the array passed in.

Step 2 - Create a generate compliment function

  • Create a function called generateCompliment that takes no parameters.
  • Create an array named bodyParts, assign it string values such as hair, teeth, ears...
  • Create an array named adjectives, assign it string values such as beautiful, wonderful... use your imagination or refer to links below
  • Create an array named randomWord, assign in string values such as flying........ again use imagination or refer to links below
  • Create a variable named string, call your pickRandomWord function passing through your arrays to generate a string with output similar to "Your" + bodyParts + "are like a" + adjective + " " + randomWord + "!!!!!!" Make it your own
  • Your function should return the variable string. Hint you should console.log(string) to see the output.
Test your compliment function
  • Invoke your generateCompliment function
  • Run node compliment.js
  • If programmed correctly you should see a random compliment string.
    ex. output = Your face is like a beautiful test !!!!!
    

Resources

Stretch Goals

  • Think of more words to put inside your arrays to make the compliment even better.

compliment-generator's People

Contributors

tylernchls avatar christie-reindle 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.