Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7561f0f

Browse files
Warning when output is full
1 parent 5b300ff commit 7561f0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎pseudocode.html‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ <h2 align="center">Pseudocode to JavaScript Compiler</h2>
2727
</div>
2828
<script>
2929
var user_input;
30+
let max_lines = 28;
3031
function print(line) {
32+
let lines = document.getElementById("program_output").innerHTML.split('\n').length;
33+
if (lines > max_lines) {
34+
alert('Too many lines of output. Please clear the output window!');
35+
throw new Error('Window full');
36+
}
3137
document.getElementById("program_output").innerHTML += line + '\n';
3238
}
3339
function run() {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /