Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 59

Thread: hey beagleman

  1. #26
    The One and Only trixie's Avatar
    Join Date
    Oct 2004
    Location
    In your dreams.
    Posts
    10,097

    Default

    C is one of the easiest languages to learn though. What's python like? My dad taught himself python a couple of years ago, but I don't know anything about it.

    I've done a little about scripting languages with perl though.
    Originally made by LM:


    ~ I have said nothing because there is nothing I can say that would describe how I feel as perfectly as you deserve it. -- Kyle Schmidt ~

    ~Silence is one of the hardest arguments to refute. -- Josh Billings ~

    * dragon_berry**Fallen_Wings*

  2. #27
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    pythons probably the easiest language to learn. by far it has the least convoluted syntax.

  3. #28
    In reverie, I felt you holding me. Dogar The Brave's Avatar
    Join Date
    Apr 2005
    Location
    By the shore.
    Posts
    22,931

    Default

    I think after God and I smoked hookah and drank last night he randomly just fixed it.

    Your an absolutely wonderful man, any girl that is yours is lucky and I know that from personal experience. ~KMT

  4. #29
    I do things like get in a taxi and say, "The library, and step on it. Lord's Avatar
    Join Date
    Nov 2007
    Posts
    8,876

    Default

    when did god start coding and why
    Well, I open my eyes and I see things. I've seen spirits moving through the walls. I've seen a vortex coming through the wall. I've seen amorphous little balls of light bouncing all around in the front yard through the window. I've seen giant bugs on the floor. I was in a hotel room in Amarillo, Texas, and all I remember is standing on the bed and seeing the whole wall in front of me filled with lights that were [makes popping sound] popping like popcorn out of the wall. Then I'll wake up and I go "Wow, I was standing on my bed and staring at this wall."

  5. #30
    In reverie, I felt you holding me. Dogar The Brave's Avatar
    Join Date
    Apr 2005
    Location
    By the shore.
    Posts
    22,931

    Default

    School and he will never will again.

    Your an absolutely wonderful man, any girl that is yours is lucky and I know that from personal experience. ~KMT

  6. #31
    The One and Only trixie's Avatar
    Join Date
    Oct 2004
    Location
    In your dreams.
    Posts
    10,097

    Default

    Quote Originally Posted by Rayne View Post
    pythons probably the easiest language to learn. by far it has the least convoluted syntax.
    I've heard it doesn't require explicit declaration of variables, and stuff like that?
    Originally made by LM:


    ~ I have said nothing because there is nothing I can say that would describe how I feel as perfectly as you deserve it. -- Kyle Schmidt ~

    ~Silence is one of the hardest arguments to refute. -- Josh Billings ~

    * dragon_berry**Fallen_Wings*

  7. #32
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    Yeah you just type x=4 and it generates a variable for you. It's really convenient but I can't imagine using it for really intensive programs. I don't trust it to manage memory for me.

  8. #33
    The One and Only trixie's Avatar
    Join Date
    Oct 2004
    Location
    In your dreams.
    Posts
    10,097

    Default

    We might have to learn it next year, so I'm not bothering with it for the present.
    Originally made by LM:


    ~ I have said nothing because there is nothing I can say that would describe how I feel as perfectly as you deserve it. -- Kyle Schmidt ~

    ~Silence is one of the hardest arguments to refute. -- Josh Billings ~

    * dragon_berry**Fallen_Wings*

  9. #34
    Defenestration is imminent pichubro's Avatar
    Join Date
    Mar 2005
    Location
    Kaleidoscope Of Mathematics
    Posts
    18,281

    Default

    I would like to learn C, and I'm trying to pick up Python on my own, but the more I use Java the more I dislike it.

    Mainly because right now I'm trying to code and every time I compile I get a "filename.java use unsafe operations!!" warning. I think it's because I'm using an ArrayList.

  10. #35
    Defenestration is imminent pichubro's Avatar
    Join Date
    Mar 2005
    Location
    Kaleidoscope Of Mathematics
    Posts
    18,281

    Default

    I'm not good with arrays...

    Or really anything outside the most basic methods. >_>

  11. #36
    what about .. eyebrows God's Avatar
    Join Date
    Apr 2005
    Location
    among the people
    Posts
    49,771

    Default

    Quote Originally Posted by Rayne View Post
    also i dont understand what youre trying to do here. at first i assumed you were trying to count the number of characters but youre doing weird arithmetic with sum. either way, i think the cause of the infinite loop is that after the second while, though youre asking them to type a sentence, youre only scanning the first character which will never be a period unless you just enter a period. the loop only stops when the scanned character is a period so yeah infinite loop for anything other than a period.
    its a lab for my class. heres what its supposed to do:
    User enters a message, ending with a period. Convert the characters into their integer values, sum up the values, get the remainder of that sum when divided by 64, then display that value as a character.

    most of it works fine, if i take out the main loop and just run whats inside of it, it gives back the right values for the messages and terminates when i just put in a period. but the program is supposed to prompt the user to keep entering messages UNTIL they just enter a period.

    i think the problem is this:
    the second while loop goes until it encounters a period, does all its shit, then goes back, the main loop says the sum wasn't 46(integer value of '.') so it runs the program again, but the last thing the second while loop scanned in was a period, so it still retains that period and is in an infinite loop.

    i can get it out of an infinite loop if i give checksum some random value after everything else, since then the last value isn't a period anymore, but then it fucks with the sums. i need to find a way to clear scanf or something.

  12. #37
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    Yeah I don't get C. If this was C++ I would've just kept entering strings into a character array and used a for loop to sum up the integer values of the characters till it hit a period and then used a flag to get it out of the overarching input loop.

  13. #38
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    Code:
    char str[20];
    int sum=0
    do
    {
        cin.getline(str, 20);
        for(int i=0; (str[i]!=NULL) || (str[i]!='.'); i++)
            sum+=(int)str[i];
    }while(str[i]!='.')
    cout<<(char)sum%64;

  14. #39
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    Pretty simple. Maybe trixie can convert that to C or something idk.

  15. #40
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    C should have an input method better than gay shit like scanf.

  16. #41
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    Why the hell are you using 46 as a condition?

  17. #42
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    nvm

  18. #43
    what about .. eyebrows God's Avatar
    Join Date
    Apr 2005
    Location
    among the people
    Posts
    49,771

    Default

    yeah, the grad student who runs the lab sessions found it odd we were doing this program before we got into strings and arrays

  19. #44
    what about .. eyebrows God's Avatar
    Join Date
    Apr 2005
    Location
    among the people
    Posts
    49,771

    Default

    overall this class is laid out terribly, by far the worst class i've ever taken. i really dont think i'd hate programming if my introduction to it wasnt THIS CLASS.

  20. #45
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    Your first while is checking the value of sum, which will never be equal to 46 because it can only be either zero or the sum of the integer values of all the characters you've entered. So it's an infinite loop.

  21. #46
    what about .. eyebrows God's Avatar
    Join Date
    Apr 2005
    Location
    among the people
    Posts
    49,771

    Default

    the sum is 46 when just a period is entered, which is when the program is supposed to terminate. the second while loop under the same condition works fine.

  22. #47
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    Yeah the sum is 46 when just a period is entered, but you're never going to enter just a period. At the beginning, sum is zero. At the end of the sentence, when it hits the period, sum is the sum of the integer values of all the characters you've entered so far.

  23. #48
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    Do this: make the first loop and second loop have the same condition, then get rid of the if statement after the second loop and put everything within it outside the two loops.

  24. #49
    what about .. eyebrows God's Avatar
    Join Date
    Apr 2005
    Location
    among the people
    Posts
    49,771

    Default

    im not sure what you mean. it scans and then sums each character before re-checking its condition. if just a period is entered it will scan that period and enter 46 into sum. the if statement uses that and works fine.

  25. #50
    Registered Users Regular Rayne's Avatar
    Join Date
    Mar 2009
    Posts
    8,585

    Default

    Something like this:

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    #define SENTINEL '.'
    
    int main()
    {
    
        char checksum, finalcheck;
        int sum, check;
    
        sum = 0;
    
        while(checksum != SENTINEL)
        {
    
            printf("Enter a one-line message. Complete your message with a period.\n");
            printf("Enter a message: ");
    
            while(checksum != SENTINEL)
            {
                scanf("%c", &checksum);
                sum += (int)checksum;
            }
         
        }
    
    check = sum % 64;
    
    finalcheck = (char)(check + 32);
    
    printf("Checksum: %c\n", finalcheck);
    
    return(EXIT_SUCCESS);
    }

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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