Small SCAR Challenge.

Discussion in 'Scar/Simba General Discussion' started by Hey321, Oct 1, 2009.

Small SCAR Challenge.
  1. Unread #1 - Oct 1, 2009 at 10:35 PM
  2. Hey321
    Joined:
    Jul 30, 2007
    Posts:
    503
    Referrals:
    0
    Sythe Gold:
    0

    Hey321 Forum Addict

    Small SCAR Challenge.

    I recently wrote a cypher encoder/decoder, and wanted to try something.

    I will post my algorithm for it, so you can run it through that, then I'll post the output, and your job is to find the four letter code word that deciphers my code properly.

    Output that is being looked for:

    The first person to post the sentence "Candles are awesome" wins.

    Here is a list of four letter words I'll be taking my code word from:

    http://www.scrabble.org.au/words/fours.htm

    Here is my Decoder, with the string to decode already placed in the "ToDecrypt" constant slot.

    Code:
    program Cypher_Decrypt;
    
    var
      C1, C2, Return, Decrypted, Decrypting : string;
      I : Integer;
    
    const
      CodeWord = '';
      ToDecrypt = '5+@ B,A?5 3@A?21 52 32?5 5+@ ?@15@1(@ "(R1)/@? RA@ R8@?20@" 8,1?K';
    
    begin
      Return := CodeWord;
      For I := 1 to length(Return) do
      begin
        if length(C1) < 13 then
        begin
          C1 := C1 + strget(Return, I);
        end else
          C2 := C2 + Strget(Return, I);
      end;
      C1 := Uppercase(C1);
      C2 := Uppercase(C2);
      For I := 40 to 94 do
      begin
        If length(C1) < 27 then
        begin
          If Pos(chr(I), C1) = 0 then
            If Pos(chr(I), C2) = 0  then
              C1 := C1 + chr(I);
        end else
            begin
        If length(C2) < 27 then
        begin
          If Pos(chr(I), C1) = 0 then
            If Pos(chr(I), C2) = 0  then
              C2 := C2 + chr(I);
        end;
      end;
      end;
      Decrypting := uppercase(ToDecrypt);
      For I := 1 to length(ToDecrypt) do
      begin
        If Pos(Strget(Decrypting, I), C1) <> 0 then
        begin
          Decrypted := Decrypted + Strget(C2, Pos(Strget(Decrypting, I), C1));
        end else
          begin
          If Pos(Strget(Decrypting, I), C2) <> 0 then
          begin
            Decrypted := Decrypted + Strget(C1, Pos(Strget(Decrypting, I), C2));
          end else
            Decrypted := Decrypted + strget(Decrypting, I);
        end;
      end;
      Cleardebug;
      WriteLn(Decrypted);
    end.
    Hint:

    For To Dos!

    ~Sandstorm
     
  3. Unread #2 - Nov 14, 2009 at 10:49 PM
  4. The Pocked Man
    Joined:
    Nov 14, 2009
    Posts:
    29
    Referrals:
    0
    Sythe Gold:
    0

    The Pocked Man Member

    Small SCAR Challenge.

    SERF

    What do I win? :D
     
  5. Unread #3 - Nov 15, 2009 at 2:45 AM
  6. The Pocked Man
    Joined:
    Nov 14, 2009
    Posts:
    29
    Referrals:
    0
    Sythe Gold:
    0

    The Pocked Man Member

    Small SCAR Challenge.

    also... enjoy ;)

    Code:
    program New;
    Function SwitchLetters(S:String;Key:String):String;
    Var
    i:integer;
    begin
     for i:= 1 to Length(S) do
      begin
      if (ord(UPPERCASE(s[i])[1]) >= 40) and (ord(UPPERCASE(s[i])[1]) <= 93) then
      s[i]:=chr(ord(s[i])-ord(UPPERCASE(s[i])[1])+ord(UPPERCASE(Key[ord(UPPERCASE(s[i])[1])-39])[1]));
      end;
     Result := s;
    end;
    
    Function CreateMap(S:String):String;
    var
    i:integer;
    A,B:string;
    begin
     for i := 40 to 93 do
      begin
       if pos(chr(i),S) = 0 then a:=a+chr(i);
       b:=b+'x';
      end;
      a:=s+a;
     for i := 1 to 54 do
      begin
       if i <= 27 then B[ord(a[i+27])-39]:=a[i];
       if i > 27 then B[ord(a[i-27])-39]:=a[i];
      end;
      Result:=B;
    end;
    
    begin
     WriteLn(SwitchLetters('THE FIRST PERSON TO POST THE SENTENCE "CANDLES ARE AWESOME" WINS.',CreateMap('SERF')));
     WriteLn(SwitchLetters('5+@ B,A?5 3@A?21 52 32?5 5+@ ?@15@1(@ "(R1)/@? RA@ R8@?20@" 8,1?K',CreateMap('SERF')));
     WriteLn(SwitchLetters('4+C4 7C3 (/4(@4C?/?/*!',CreateMap('DIRKA')));
    end.
     
< farmwille painting script ?? | For Sale Nokia 5800 XpressMusic.....€100 euro >

Users viewing this thread
1 guest


 
 
Adblock breaks this site