Advertisement
asolntsev

Untitled

Apr 5th, 2011
2,855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function S_Prnt_Str (options) {
  2.     if (options.stroka.length >= 0) {
  3.         if (typeof options.stroka == typeof 'string') {
  4.             if (console) {
  5.                 if ('console' in window) {
  6.                     if ('log' in window.console) {
  7.                         try {
  8.                             console.log(options.stroka);
  9.                         } catch (owibka) {
  10.                             throw owibka;
  11.                         }
  12.                     } else {
  13.                         throw new Error('Net funccii log');
  14.                     }
  15.                 } else {
  16.                     throw new Error('Konsoli net v window');
  17.                 }
  18.             } else {
  19.                 throw new Error('Konsoli net');
  20.             }
  21.         } else {
  22.             throw new Error('Eto ne stroka');
  23.         }
  24.     } else {
  25.         throw new Error('U stroki net length');
  26.     }
  27. }
  28.  
  29. cho = true;
  30.  
  31. try {
  32.  
  33.     for (i = 1; i <= 6; i++) {
  34.         if (cho == true) {
  35.             try {
  36.                 stroka = '';
  37.                 for (j = 1; j <= i; j++) {
  38.                     if (stroka == '') {
  39.                         stroka = stroka + j;
  40.                     } else {
  41.                         stroka = stroka + '-' + j;
  42.                     }
  43.                 }
  44.                 S_Prnt_Str({stroka: stroka});
  45.                 cho = false;
  46.             } catch  (owibka) {
  47.                 if (owibka instanceof Error) {
  48.                     throw new Error(owibka.message);
  49.                 } else {
  50.                     throw new Error('Owibka ne owibka');
  51.                 }
  52.             }
  53.         } else if (cho == false) {
  54.             try {
  55.                 stroka = '';
  56.                 for (j = 1; j <= i; j++) {
  57.                     if (stroka == '') {
  58.                         stroka = stroka + j;
  59.                     } else {
  60.                         stroka = j + '-' + stroka;
  61.                     }
  62.                 }
  63.                 S_Prnt_Str({stroka: stroka});
  64.                 cho = true;
  65.             } catch  (owibka) {
  66.                 if (owibka instanceof Error) {
  67.                     throw new Error(owibka.message);
  68.                 } else {
  69.                     throw new Error('Owibka ne owibka');
  70.                 }
  71.             }
  72.         } else {
  73.             throw new Error('Owibka!!!');
  74.         }
  75.     }
  76.  
  77. } catch  (owibka) {
  78.     if (owibka instanceof Error) {
  79.          throw new Error(owibka.message);
  80.     } else {
  81.          throw new Error('Owibka ne owibka');
  82.     }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement