SHARE
TWEET

Untitled

a guest Sep 27th, 2017 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* The below code does not do input validation. It assumes the input string is a sequence of numbers */
  2.  
  3. ReallyBigRegister D;
  4. char c;
  5. char EOL = 0x0D;
  6. char Subtract1 = 0x30;
  7. char Subtract2 = 0x37; // Might require some fine-tuning
  8.  
  9. Start:
  10.  
  11. For each character in String
  12. c = String[x];
  13.    If c =/= EOL        // Check if character is end of line
  14.         If c > 39
  15.            c = c-Subtract1;
  16.            Goto Shift
  17.         Else
  18.            c = c-Subtract2;
  19.    Else
  20.  
  21.  
  22. Shift:
  23.  
  24. D=(D<<4)|c;
  25. //Could also use (D<<4)+c;
  26. Goto Start
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top