Beaufort CalculatorThis page defines a Beaufort Calculator. Try "DEFENDTHEEASTWALLOFTHECASTLE" with a key of "FORTIFICATION". Try!, which should give: CKMPVCPVWPIWUJOGIUAPVWRIWUUK Check |
Examples
- Try "Whoever has made a voyage up the Hudson must remember the Kaatskill mountains" with a key of "RIPVANWINKLE". Try!, which should give: VBBRF JFBNS ZEOEP AMPWC JQWLK EIBXV IVBQT LAEDR OMSRU DHURI WDQFL XBWRR YIHII. Check
- Try "attackatdawn" with a key of "lemon". Try!, which should give: lltolbetlnpr.
Sample code
public string getBeau(string s, string key) { for (int i = 0; i < 10; i++) key += key; string s1 = ""; try { for (int i = 0; i < s.Length; i++) { string ss = s.Substring(i, 1); char c = (char)ss[0]; int v=0; if ((int)key[i]>=(int)c) v = ((int)'a' + ((int)key[i] - (int)c)); else v = ((int)'z' + 1+ ((int)key[i] - (int)c)); if (ss == " " || ss == "." || ss == "," || ss == "-" || ss == ":") s1 += ss; else s1 += (char)v; } return (s1); } catch { return (s1.ToLower()); } }