Skip to content
Snippets Groups Projects
Commit e3648b35 authored by deuce's avatar deuce
Browse files

Make interactive mode for people without checksum functions better.

parent c7776f12
Branches
Tags
No related merge requests found
...@@ -54,9 +54,37 @@ function interactive_or_string(str, x, y) ...@@ -54,9 +54,37 @@ function interactive_or_string(str, x, y)
} }
if (!interactive) if (!interactive)
return null; return null;
console.gotoxy(x, y+1); if (x > 3) {
var ret = console.yesno("Do you see the string \""+str+"\" on the line above"); console.gotoxy(x - 2, y);
console.clear(); console.print("\x01H\x01Y->\x01N\b");
}
else {
console.gotoxy(x+str.length, y);
console.print("\x01H\x01Y<-\x01N\b");
}
if (y < console.screen_rows / 2)
console.gotoxy(1, console.screen_rows - 2);
else
console.gotoxy(1, 1);
console.cleartoeol();
var ret = console.yesno("Do you see the string \""+str+"\" at the yellow arrow");
if (x > 3) {
console.gotoxy(x - 2, y);
console.print("\x01N \b");
}
else {
console.gotoxy(x+str.length, y);
console.print("\x01N \b");
}
if (y < console.screen_rows / 2) {
console.gotoxy(1, console.screen_rows - 2);
console.write("\x1b[0J");
}
else {
console.gotoxy(1, 3);
console.write("\x1b[1J");
}
return ret; return ret;
} }
...@@ -948,7 +976,7 @@ var tests = [ ...@@ -948,7 +976,7 @@ var tests = [
{'name':'DECRQCRA', 'func':function() { {'name':'DECRQCRA', 'func':function() {
console.write("\x1b[1;1;1;1;1;1*y"); console.write("\x1b[1;1;1;1;1;1*y");
var ras = read_ansi_string(500); var ras = read_ansi_string(500);
if (ras.search(/^\x1bP1!~[a-zA-Z0-9]{4}\x1b\\$/) !== -1) if (ras === null || ras.search(/^\x1bP1!~[a-zA-Z0-9]{4}\x1b\\$/) !== -1)
return true; return true;
return false; return false;
}}, }},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment