|
|
@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
function Abort()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new Error('This is not an error. This is just to abort javascript');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function run() {
|
|
|
|
function run() {
|
|
|
|
const console = document.getElementById("console");
|
|
|
|
const console = document.getElementById("console");
|
|
|
@ -34,13 +38,13 @@ function run_init() {
|
|
|
|
if (document.getElementById("console") != '') {
|
|
|
|
if (document.getElementById("console") != '') {
|
|
|
|
document.getElementById("console").innerHTML = '';
|
|
|
|
document.getElementById("console").innerHTML = '';
|
|
|
|
run();
|
|
|
|
run();
|
|
|
|
// setTimeout(() => {console.log("Resolve while pb")}, 1000);
|
|
|
|
//setTimeout(() => {console.log("Resolve while pb")}, 1000);
|
|
|
|
// setTimeout(() => {location.reload();}, 1000);
|
|
|
|
//setTimeout(() => {Abort()}, 5000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
run();
|
|
|
|
run();
|
|
|
|
// setTimeout(() => {console.log("Resolve while pb")}, 1000);
|
|
|
|
//setTimeout(() => {console.log("Resolve while pb")}, 1000);
|
|
|
|
// setTimeout(() => {location.reload();}, 1000);
|
|
|
|
//setTimeout(() => {Abort()}, 5000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -100,9 +104,6 @@ function exec(code, id) {
|
|
|
|
//~ Function that check if the code in the editor as the same result as the solution.
|
|
|
|
//~ Function that check if the code in the editor as the same result as the solution.
|
|
|
|
|
|
|
|
|
|
|
|
function check(){
|
|
|
|
function check(){
|
|
|
|
console.log(retourSolution)
|
|
|
|
|
|
|
|
console.log(retourCode)
|
|
|
|
|
|
|
|
console.log(retourSolution == retourCode)
|
|
|
|
|
|
|
|
if (retourSolution == "ERROR") {
|
|
|
|
if (retourSolution == "ERROR") {
|
|
|
|
result.innerHTML = "Il semblerait qu'il y a une erreur dans ton code :/";
|
|
|
|
result.innerHTML = "Il semblerait qu'il y a une erreur dans ton code :/";
|
|
|
|
result.classList.remove('hidden');
|
|
|
|
result.classList.remove('hidden');
|
|
|
@ -130,12 +131,19 @@ def estPalindromeVerif(var):
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
def testPalindrome(x):
|
|
|
|
def testPalindrome(x):
|
|
|
|
|
|
|
|
l=[1,2,3,2,1]
|
|
|
|
|
|
|
|
if(estPalindrome(l)==False):
|
|
|
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
l=[9,5,7,7,9]
|
|
|
|
|
|
|
|
if(estPalindrome(l)==True):
|
|
|
|
|
|
|
|
return False
|
|
|
|
l=[]
|
|
|
|
l=[]
|
|
|
|
for i in range(x):
|
|
|
|
for i in range(x):
|
|
|
|
for j in range(r.randint(1,10)):
|
|
|
|
for j in range(r.randint(1,10)):
|
|
|
|
l.append(r.randint(0,9))
|
|
|
|
l.append(r.randint(0,9))
|
|
|
|
if(estPalindrome(l)!=estPalindromeVerif(l)):
|
|
|
|
if(estPalindromeVerif(l)!=estPalindrome(l)):
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
l=[]
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
print(testPalindrome(5))
|
|
|
|
print(testPalindrome(5))
|
|
|
|