Last active
January 22, 2018 14:58
-
-
Save tbfleming/2f7baf1120967895c2b07b09eddb576c to your computer and use it in GitHub Desktop.
cib demo: custom console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
for(int i = 0; i < 20; ++i) { | |
for(int j = 0; j < 20; ++j) | |
printf("%02d ", j); | |
printf("\n"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%init-scripts% | |
<style> | |
html, | |
body { | |
width: 100%; | |
height: 100%; | |
overflow: hidden; | |
} | |
div { | |
position: absolute; | |
left: 10px; | |
right: 10px; | |
top: 10px; | |
bottom: 10px; | |
padding: 10px; | |
background-color: cyan; | |
overflow: auto; | |
} | |
pre { | |
margin: 0px; | |
} | |
</style> | |
<div> | |
<pre id='console'></pre> | |
</div> | |
<script> | |
'use strict'; | |
let console = document.getElementById('console'); | |
emModule.print = emModule.printErr = msg => { | |
console.textContent += msg + '\n'; | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment