You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Scripted/WEB/View/src/JS/String.js

34 lines
637 B

//~ Function that test the user code
async function submit(){
var test = editor.getValue()+`\n
import random as r
def triVerif(a,b):
s = ""
i = 0
while len(s)<len(a+b):
if(len(a)>i):
s += a[i]
if(len(b)>i):
s += b[i]
i += 1
return s
def triTest(x):
a = "Hlowrd"
b = "el ol"
if(triVerif(a,b)!=tri(a,b)):
return False
return True
print(triTest(5))
`;
exec("print('True')", "code");
exec(test, "solution");
result.innerHTML = "Test en cours...";
await new Promise(r => setTimeout(r, 1500));
check();
}