mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-22 20:40:18 +00:00
...
This commit is contained in:
parent
9d0d4d1841
commit
145b36b677
@ -276,17 +276,16 @@ DEALINGS IN THE SOFTWARE.
|
||||
let code_output = document.querySelector('#code-output');
|
||||
let run_button = document.querySelector('#run-button');
|
||||
|
||||
code_editor.textContent = '# A recursive fibonacci function.\ndef fib(n):\n if n < 2:\n return n\n return fib(n-1) + fib(n-2)\n\n# Prints all fibonacci from 0 to 10 exclusive.\nfor i in range(10):\n print(f"fib({i}) = {fib(i)}")\n';
|
||||
|
||||
let highlight = withLineNumbers(function (editor) {
|
||||
editor.textContent = editor.textContent;
|
||||
hljs.highlightElement(editor);
|
||||
});
|
||||
|
||||
highlight(code_editor);
|
||||
|
||||
CodeJar(code_editor, highlight); //, { indentOn: /[(\[{:]$/});
|
||||
|
||||
code_editor.textContent = '# A recursive fibonacci function.\ndef fib(n):\n if n < 2:\n return n\n return fib(n-1) + fib(n-2)\n\n# Prints all fibonacci from 0 to 10 exclusive.\nfor i in range(10):\n print(f"fib({i}) = {fib(i)}")\n';
|
||||
|
||||
window.onload = function () {
|
||||
run_button.onclick = function () {
|
||||
code_output.innerText = '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user