Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var quote = '"';
- var apostrophe = "'";
- var print_out, main;
- var ce_code = "function concat_eval (lines) {var l; var c = ''; for (l = 0; l < lines.length; l ++) c = c.concat(lines[l]); return eval(c);}";
- eval(ce_code);
- var po_code = [
- "print_out = function (variable_name, contents) {",
- " if ((typeof contents) == 'string') {",
- " document.writeln('var ', variable_name, ' = ', quote, contents, quote, ';');",
- " document.writeln('eval(', variable_name, ');');",
- " } else {",
- " document.writeln('var ', variable_name, ' = [');",
- " var current_line;",
- " for (current_line = 0; current_line < contents.length; current_line ++)",
- " document.writeln(' ', quote, contents[current_line], quote, (current_line == (contents.length - 1)) ? '' : ',');",
- " document.writeln('];');",
- " document.writeln('concat_eval(', variable_name, ');');",
- " }",
- " document.writeln();",
- "}"
- ];
- concat_eval(po_code);
- var main_code = [
- "main = function () {",
- " var code_items = ['ce_code', 'po_code', 'main_code'];",
- " document.writeln('var quote = ', apostrophe, quote, apostrophe, ';');",
- " document.writeln('var apostrophe = ', quote, apostrophe, quote, ';');",
- " document.writeln('var print_out, main;');",
- " document.writeln();",
- " var code_item;",
- " for (code_item = 0; code_item < code_items.length; code_item ++)",
- " print_out(code_items[code_item], eval(code_items[code_item]));",
- " document.writeln('main();');",
- "}"
- ];
- concat_eval(main_code);
- main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement