/ping_pong

independent project practicing BBD and FOR loops

Primary LanguageHTML

Ping Pong Calculator

_A numbers game that returns Ping, Pong, or Ping-Pong depending on the user input, 8/26/2016 _

By Anand Angalig

Description

Enter any number as the PING, and we will return a PONG by counting from 1 to your number with three exceptions:

  • Numbers divisible by 3 are replaced with "ping"
  • Numbers divisible by 5 are replaced with "pong"
  • Numbers divisible by 15 are replaced with "ping-pong"

Specs:

  • If user enters not-a-number (i.e. letters and/or signs), the program will not work and display a message requesting to enter an actual number.
    • input: hello
    • output: "Please enter a number and try again!"
  • If user enters a number that is less than the first translatable number (e.g. 3 to Ping), the program will simply count up to the entered number.
    • input: 2
    • output: 1,2
  • If user enters a number that is equal to the first translatable number, the program will count up to the inputted number and replace it with the corresponding word.
    • input: 3
    • output: 1,2,Ping
  • If user enters a number, the program will count up to the inputted number while returning Ping, Pong, or Ping-Pong for numbers divisible by 3, 5, or 15 respectively.
    • input: 5
    • output: 1,2,Ping,4,Pong
  • If user enters a number, the program will count up to the inputted number while returning the in-divisible numbers as it is, while returning Ping, Pong, or Ping-Pong for numbers divisible by 3, 5, or 15 respectively.
    • input: 6
    • output: 1,2,Ping,4,Pong,6
  • If user enters a number, the program will count up to the inputted number while returning the in-divisible numbers as it is, while returning Ping, Pong, or Ping-Pong for numbers divisible by 3, 5, or 15 respectively.
    • input: 15
    • output: 1,2,Ping,4,Pong,Ping,7,8,Ping,Pong,11,Ping,13,14,Ping-Pong.

Setup/Installation Requirements

Known Bugs

No known bugs reported so far. If you find one, please let me know via email at anandangalig@gmail.com

Technologies Used

  • Jquery

License

This game is licensed under the MIT License agreement.

Copyright (c) 2016 Anand Angalig