nickel2halide

cryptcow

Feb 26th, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.36 KB | None | 0 0
  1. /*
  2.                               c           o     w
  3. "Begin the Escape exeOt the BnCak cutioWofO aCreW Dawn"
  4. unenc(c, o, w)
  5. "Begin the Escape exeOt the Bn aCreak cutioWof Dawn"
  6. RIGHT
  7. ...
  8. reenc(c, o, w)
  9. "Begin the Escape CnCak OexeOt the BWcutioWofO aCreW Dawn"
  10. NOT
  11. "Begin the Escape exeOt the BnCak cutioWofO aCreW Dawn"
  12. */
  13.  
  14.  
  15. void unenc(int c, int o, int w) {
  16.     if (next[c] == o) {
  17.         if (next[o] == w) {
  18.             next[prev[c]] = next[w];
  19.             prev[next[w]] = prev[c];
  20.         } else {
  21.             next[prev[c]] = next[o];
  22.             prev[next[o]] = prev[c];
  23.                        
  24.             next[prev[w]] = next[w];
  25.             prev[next[w]] = prev[w];
  26.         }
  27.     } else {
  28.         if (next[o] == w) {
  29.             next[prev[c]] = next[c];
  30.             prev[next[c]] = prev[c];
  31.  
  32.             next[prev[o]] = next[w];
  33.             prev[next[w]] = prev[o];
  34.         } else {
  35.             next[prev[c]] = next[o];
  36.             prev[next[o]] = prev[c];
  37.            
  38.             next[prev[w]] = next[c];
  39.             prev[next[c]] = prev[w];
  40.            
  41.             next[prev[o]] = next[w];
  42.             prev[next[w]] = prev[o];
  43.         }
  44.     }
  45. }
  46.  
  47. void reenc(int c, int o, int w) {
  48.     next[prev[c]] = c;
  49.     prev[next[c]] = c;
  50.  
  51.     next[prev[o]] = o;
  52.     prev[next[o]] = o;
  53.  
  54.     next[prev[w]] = w;
  55.     prev[next[w]] = w;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment