Nidhogg

Untitled

Jun 18th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. short int letterToInt(char a)
  2. {
  3.     if(a <109) // m
  4.     {
  5.         if(a < 103) // g
  6.         {
  7.             if(a< 100) // d
  8.                 return 0; // a b c
  9.             else
  10.                 return 1; // d e f
  11.         }
  12.         else
  13.         {
  14.             if(a < 106) // j
  15.                 return 2; // g h i
  16.             else
  17.                 return 3; // j k l
  18.         }
  19.     }
  20.     else
  21.     {
  22.         if(a < 116) // t
  23.         {
  24.             if(a < 112) // p
  25.                 return 4; // m n o
  26.             else
  27.                  return 5; // p q r s
  28.         }
  29.         else
  30.         {
  31.             if(a < 119)
  32.                 return 6; // t u v
  33.             else
  34.                 return 7; // w x y z
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment