Results 1 to 14 of 14

Thread: cipher challenge

  1. #1
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default cipher challenge

    Well my school is doing this cipher challenge and i can do it but changing it all back to english takes for every is there any way i can change every like 'x' to 'a' or do i have to do it all by hand
    Thanks
    I see Now, says the blind man

  2. #2
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    What's a cipher challenge ?

    If you're talking about a scar, you can explode your string and than replace any x with a or whatever.

  3. #3
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by caused View Post
    What's a cipher challenge ?

    If you're talking about a scar, you can explode your string and than replace any x with a or whatever.
    Unless ive posted in the worng place its got nothing to do with scar
    I.E if its + 1
    In the cipher

    hi
    would be want we need to find out and it would be

    lg

    is the cipher or encoded version of hi
    Last edited by rya; 10-01-2009 at 11:35 PM.
    I see Now, says the blind man

  4. #4
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Post a sample cipher with the solved one (preferably something like The quick fox jumped over the lazy dog, so it has all the letters), and I can whip up a fast script that'll replace everything really fast.

    ~Sandstorm

  5. #5
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Here ya go sandstorm

    Code:
    The quick fox jumped over the lazy dog
    and the cipher for it is
    if the value is + 2

    Code:
     
    VJG SWKEM  HQZ LWORGF QXGT VJG NCBA FQI
    Its in caps as ciphers asways are
    I think its right but will check
    Also this is a plus 2 so in a alphabet wheel to find it out i would move 2 along so depending on the + 'a' could stand for anything from 'a'to 'z' but if the a stands for 'a' its not 'a' cipher
    Last edited by rya; 10-01-2009 at 11:53 PM.
    I see Now, says the blind man

  6. #6
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Forgot one word, can you change brown over?

    Edit:

    Nevermind, I figured out what you meant by the +2.
    ~Sandstorm

  7. #7
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea brown would be

    DTQYP

    Rember it needs to work with diffrent +'s (im showing you plus 2)
    I see Now, says the blind man

  8. #8
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright, just got to get one thing working.

    ~Sandstorm

  9. #9
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks
    I see Now, says the blind man

  10. #10
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    SCAR Code:
    program New;
    const
      Adjustment = 2;
      Input = 'The quick fox jumped over the lazy dog';
    var
      i, cMin, cMax, c: Integer;
      s: string;
    begin
      s := UpperCase(Input);
      cMin := Ord('A');
      cMax := Ord('Z');
      for i := 1 to Length(Input) do
      begin
        c := Ord(s[i]);
        if InRange(c, cMin, cMax) then
        begin
          c := c + Adjustment;
          if (c < cMin) then
            c := cMax - (cMin - c) + 1
          else if (c > cMax) then
            c := cMin + (c mod cMax) - 1;
          s[i] := Chr(c);
        end;
      end;
      WriteLn(s);
    end.

  11. #11
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This should do it:

    Place the string you want to replace in the Codecrack constant, and the number it increases by in the Plus constant.

    SCAR Code:
    program new;
    var
      i : integer;
      return : string;
      cipherreturn : byte;
     
    const
      codecrack = 'The quick fox jumped over the lazy dog.';
      Plus = 2;
     
    begin
      For I := 0 to length(codecrack) - 1 do
      begin
        If codecrack[i + 1] = ' ' then
        begin
          return := return + ' ';
          continue;
        end;
        If ((getkeycode(codecrack[i + 1])) > 90) or ((getkeycode(codecrack[i + 1])) < 65) then
        begin
          return := return + codecrack[i + 1];
          continue;
        end;
        If (getkeycode(codecrack[i + 1]) + plus) > 90 then
        begin
          cipherreturn := getkeycode(codecrack[i + 1]) + plus - 26;
          return := return + chr(cipherreturn);
        end else
        begin
          cipherreturn := getkeycode(codecrack[i + 1]) + plus;
          return := return + chr(cipherreturn);
        end;
      end;
      writeln(return);
    end.

    Should ignore all punctuation, and return all the letters correctly.

    Edit:

    Lol, you're mean Nielsie ^.^.

    ~Sandstorm

  12. #12
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Sorry, couldn't resist
    Want me to delete my post? xD

  13. #13
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by nielsie95 View Post
    Sorry, couldn't resist
    Want me to delete my post? xD
    I don't care, it's your call ^.^.

    Yours is better anyways, I'd have to modify mine to support negatives, yours seems to do it automatically.

    ~Sandstorm

  14. #14
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nielsie/sandstorm your great thanks
    I see Now, says the blind man

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •