title: Pythagorean Quadruple
signature: function pythagorean_quadruple(a, b, c, d)
test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(a, b, c, d, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(a, b, c, d) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(1, 1, 1, 3, false)
      print(string.format("TEST-0...%s",result))
  
      result = driver(3, 2, 5, 38, false)
      print(string.format("TEST-1...%s",result))
  
      result = driver(0, 0, 0, 0, true)
      print(string.format("TEST-2...%s",result))
  
      result = driver(-1, -1, -1, 1, false)
      print(string.format("TEST-3...%s",result))
  
      result = driver(82, 79, 6, 59, false)
      print(string.format("TEST-4...%s",result))
  
      result = driver(14, 57, 35, 29, false)
      print(string.format("TEST-5...%s",result))
  
      result = driver(6, 96, 45, 75, false)
      print(string.format("TEST-6...%s",result))
  
      result = driver(13, 7, 3, 63, false)
      print(string.format("TEST-7...%s",result))
  
      result = driver(96, 65, 72, 93, false)
      print(string.format("TEST-8...%s",result))
  
      result = driver(70, 33, 6, 2, false)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
source_py: def pythagorean_quadruple(a, b, c, d):
      sum = (((a * a) + (b * b)) + (c * c))
      if ((d * d) == sum):
          return True
      else:
          return False
source_cpp: bool pythagorean_quadruple(int a, int b, int c, int d) {
    int sum = a * a + b * b + c * c;
    if ( d * d == sum ) return true;
    else return false;
  }