Thread: how do you create a reversed Caesar's cipher or a string matrix?

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    1

    Question how do you create a reversed Caesar's cipher or a string matrix?

    I'm supposed to enter either a 16 or 9 letters in the program.

    For example: "great job you got it"

    The program is supposed to output: "gtyorjoteouiabgt"
    Last edited by mgz887; 06-24-2009 at 05:48 AM.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> The program is supposed to output: "gtyorjoteouiabgt"

    Sounds like you've got your work cut out for you then. Post the code you're having trouble with and we'll try to point you in the right direction.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271
    Quote Originally Posted by Sebastiani View Post
    >> The program is supposed to output: "gtyorjoteouiabgt"

    Sounds like you've got your work cut out for you then. Post the code you're having trouble with and we'll try to point you in the right direction.
    LMAO... simple and brutually to the point
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

  4. #4
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    There are a zillion examples of this out there, here's mine:

    ROT13.c
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #6
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    Quote Originally Posted by MK27 View Post
    There are a zillion examples of this out there, here's mine:

    ROT13.c
    your main didn't return anything
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  7. #7
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    So far as I can tell, there's not any actual Caesar cipher here? You're just putting the characters in the columns of a matrix, then printing them out by rows. (Edit: This is directed at OP, not other solutions.)
    Last edited by tabstop; 06-24-2009 at 10:33 AM.

  8. #8
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by ಠ_ಠ View Post
    your main didn't return anything
    Yeah, also I used a short int which tells me this was one of the first C programs I wrote, when I thot using a short int would save memory I should probably take a lot of things off the web for fear I accidentally corrupt another generation.

    But it is the ceasar shift.
    Last edited by MK27; 06-24-2009 at 10:31 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  9. #9
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    Quote Originally Posted by MK27 View Post

    But it is the ceasar shift.
    this thread is about the ceaser CIPHER
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  10. #10
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271
    Quote Originally Posted by MK27 View Post
    There are a zillion examples of this out there, here's mine:

    ROT13.c
    I believe the guy asked about a reversed caesar's cipher; and I also believe that the policy is to help people like him with their programming logic, not do their work for 'em.
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C - access violation
    By uber in forum C Programming
    Replies: 2
    Last Post: 07-08-2009, 01:30 PM
  2. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  3. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  4. string handling
    By lessrain in forum C Programming
    Replies: 3
    Last Post: 04-24-2002, 07:36 PM

Tags for this Thread