ForeverDev

Untitled

Oct 9th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var math = {
  2.     1 : function() {
  3.         var a = prompt("A: "), b = prompt("B: "), c = prompt("C: ")
  4.         console.log (
  5.             a == 0 && Math.sqrt(Math.pow(c, 2) - Math.pow(b, 2)) ||         b == 0 && Math.sqrt(Math.pow(c, 2) - Math.pow(a, 2)) ||
  6.             c == 0 && Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2)) ||
  7.             "error, invalid parameters"
  8.         )
  9.     }
  10. }
  11.  
  12. while ("David is cooler than Grant") {
  13.     math[parseInt(prompt(
  14.         "1) Pythagorean Theorem\n" +
  15.         "2) Other Thing To Determine"
  16.     ))]()
  17. }
Advertisement
Add Comment
Please, Sign In to add comment