Git Product home page Git Product logo

ping-pong's Introduction

Ping-Pong

Epicodus Project in JavaScript, HTML, and CSS, August 18, 2017

By Kelsey Langlois

Description

Website that takes a positive integer and prints all integers from 1 to that integer, replacing multiples of 3 with the word Ping, multiples of 5 with the word Pong, and multiples of 15 with the word Ping-Pong.

Setup/Installation Requirements

You can view this project on GitHub pages at langlk.github.io/ping-pong. To install on your own computer, follow the steps below:

  • Clone this repository
  • Open index.html in web browser of your choice

Specifications

  • Program will return an error if input is empty.
    • Example Input: ""
    • Example Output: "Error: Invalid Input"
  • Program will return an error if input is not an integer.
    • Example Input: 3.14
    • Example Output: "Error: Invalid Input"
  • Program will return an error if number is less than 1.
    • Example Input: 0
    • Example Output: "Error: Invalid Input"
  • Ping-Pong method will return a number unchanged if the number is not divisible by 3 or 5.
    • Example Input: 1
    • Example Output: 1
  • Ping-Pong method will return "Ping" if an input number is divisible by 3.
    • Example Input: 6
    • Example Output: Ping
  • Ping-Pong method will return "Pong" if an input number is divisible by 5.
    • Example Input: 20
    • Example Output: Pong
  • Ping-Pong method will return "Ping-Pong" if an input number is divisible by 15.
    • Example input: 30
    • Example Output: Ping-Pong
  • Program will create a list containing only the number 1 if the input is 1.
    • Example Input: 1
    • Example Output: 1
  • Program will create a list from one to n for any input number n.
    • Example Input: 2
    • Example Output: 1, 2
  • Program will replace numbers in the list with the values returned from Ping-Pong method.
    • Example Input: 15
    • Example Output: 1, 2, Ping, 4, Pong, Ping, 7, 8, Ping, Pong, 11, Ping, 13, 14, Ping-Pong

Support and contact details

Please contact Kelsey Langlois at [email protected] with questions, comments, or issues.

Technologies Used

  • HTML
  • CSS
  • Bootstrap
  • JavaScript

License

Copyright (c) 2017 Kelsey Langlois

This software is licensed under the MIT license.

ping-pong's People

Contributors

langlk avatar

Watchers

James Cloos 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.