//~ Function that test the user code
          
async function submit(){
    var test = editor.getValue()+`\n
def estTriangleDePascal(n):
  if(n==0):
      return []
  if(n==1):
      return [[1]]
  triangle=[[1],[1, 1]]
  columns=n
  for line in range(2,n):
      triangle.append([1])
      for column in range(1, line):
          triangle[line].append(triangle[line - 1][column - 1] + triangle[line - 1][column])
      triangle[line].append(1)
  return triangle

import random as r
def testTriangleDePascal(n):
  triangle_pascal(0)
  listTest=[0,1]
  for i in range(0,n):
   listTest.append(r.randint(5,140))
  for i in listTest:
      if(triangle_pascal(i)!=estTriangleDePascal(i)):
          return False
  return True
  
print(testTriangleDePascal(5))
    `;
    exec("print ('True')", "code"); 
    exec(test, "solution");
    result.innerHTML = "Test en cours...";
    await new Promise(r => setTimeout(r, 1500));
    check();
}
  
  