View Poll Results: Who was the best beginner?

Voters
41. You may not vote on this poll
Page 16 of 27 FirstFirst ... 6141516171826 ... LastLast
Results 151 to 160 of 268

Thread: [Beginner] Programming Challenge: 1

  1. #151
    Join Date
    Jul 2008
    Beans
    1,706

    Re: [Beginner] Programming Challenge: 1

    it takes a while to download though

  2. #152
    Join Date
    Jun 2006
    Location
    Gwangju, Korea
    Beans
    3,479

    Re: [Beginner] Programming Challenge: 1

    Quote Originally Posted by jimi_hendrix View Post
    it takes a while to download though
    Can you even download it legally, or are you talking about piracy? (I have no use for Windows-only setups anyway, legal or otherwise, free or non-free.)

  3. #153
    Join Date
    Jul 2008
    Beans
    1,706

    Re: [Beginner] Programming Challenge: 1

    yes its legal and free (at least the express adition is)

  4. #154
    Join Date
    Apr 2007
    Beans
    238
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: [Beginner] Programming Challenge: 1

    PHP Code:
    def sing(bottles 99):
        if 
    bottles == 0:
            print 
    'No more bottles of beer on the wall, no more bottles of beer.'
            
    print 'Go to the store and buy some more, 99 bottles of beer on the wall.'
            
    return 
        
        
        print 
    '%i bottle%s of beer on the wall, %i bottle%s of beer.' % (bottlesf(bottles), bottlesf(bottles))
        print 
    'Take one down and pass it around, %i bottle%s of beer on the wall.' % (bottles 1f(bottles 1))
        print 
        
        
    sing(bottles 1)

    lambda xand 's' or ''
    sing() 
    I try my best.

  5. #155
    Join Date
    Jul 2008
    Beans
    9

    Re: [Beginner] Programming Challenge: 1

    UPDATE: This code is outdated, there's a bug in it. See my entry further down for my (hopefully final code.

    Here's my python code. I'm a beginner programmer, but I'm best at python. My focus was on clean and easy code.
    PHP Code:
    #Prints 99 Bottles of Beer Song
    beers 99
    while beers 2:
        print 
    beers" bottles of beer on the wall, "beers"bottles of beer."
        
    beers beers-1
        
    print "Take one down and pass it around, "beers"on the wall."
        
    print ""
    print "1 bottle of beer on the wall, 1 bottle of beer."
    print "Take one down and pass it around, no more bottles of beer on the wall."
    print ""
    print "No more bottles of beer on the wall, no more bottles of beer."
    print "Go to the store and buy some more, 99 bottles of beer on the wall." 
    I had an awesome idea, then I did it. Why only print the lyrics? Why not get your PC to sing 'em too??!!
    That's just what I did. I installed Festival and created a text file containing all the lyrics.

    https://help.ubuntu.com/community/TextToSpeech is how. I used a 16 kilohertz American speaker.
    I've attached my text file, named beer_song.txt. Get it and put it in a directory of your choice, just remember where.

    Open a terminal and cd to your directory.
    Type: festival
    A festival prompt will come up. Type: (tts "beer_song.txt" nil)

    Assuming beer_song is in your current directory, you computer will starting singing (well, talking more like) the song to you!!!

    Yippie!

    Please let me know what you think, and any suggestions.
    My python code is my entry, to be clear. The singing is just a nice extra.
    Attached Files Attached Files
    Last edited by tjmage1; August 4th, 2008 at 03:17 PM. Reason: Bug in posted code.

  6. #156
    Join Date
    Apr 2007
    Beans
    14,781

    Re: [Beginner] Programming Challenge: 1

    Quote Originally Posted by jimi_hendrix View Post
    microsoft visual C++ 2008 is what i used (the only thing they do right is their IDE's)
    Quote Originally Posted by jimi_hendrix View Post
    yes its legal and free (at least the express adition is)
    Sorry. That isn't free. By free, I meant really free, not they release a crippled version to get students hooked and locked in.

  7. #157
    Join Date
    Apr 2008
    Beans
    54

    Re: [Beginner] Programming Challenge: 1

    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
    	int bottles = 99;
    	do
    	{
    		if (bottles == 2)
    		{
    			cout << bottles << " bottles of beer on the wall. " << bottles << " bottles of beer!" << endl;
    			cout << "You take one down, pass it around. " << bottles - 1 << " bottle of beer on the wall" << endl;
    			cout << " " << endl;
    		}
    		else
    		{
    			cout << bottles << " bottles of beer on the wall. " << bottles << " bottles of beer!" << endl;
    			cout << "You take one down, pass it around. " << bottles - 1 << " bottles of beer on the wall" << endl;
    			cout << " " << endl;
    		}
    			bottles --;
    	}
    	while (bottles >= 2);
    	
    	cout << "1 bottle of beer on the wall, one bottle of beer!" << endl;
    	cout << "You take one down, pass it around, no more bottles of beer on the wall." << endl;
    	cout << " " << endl;
    	
    	cout << "No more bottles of beer on the wall. No more bottles of beer!" << endl;
    	cout << "Go to the store, buy some more. 99 bottles of beer on the wall. (And you may also want to look into AA)" << endl;
    	
    	return 0;
    }

    A little longer than I was going to write it at first, but I realized I had to use good grammar and bleh.

  8. #158
    Join Date
    Jan 2006
    Beans
    35

    Re: [Beginner] Programming Challenge: 1

    Quote Originally Posted by rubinboy View Post
    Ha ha ha.. If you are "lazy" programming is probably not the right option for you.

    Are you sure? I often find myself writing an app that automates a process I would otherwise do a lot. Isnt that lazy?

  9. #159
    Join Date
    Jun 2008
    Beans
    204
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [Beginner] Programming Challenge: 1

    Just for my future reference how often will these challenges be being set? I want to try and keep up to date with these, but would rather not have to be constantly checking!

    Cheers

  10. #160
    Join Date
    Feb 2008
    Location
    Cape Town, South Africa
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: [Beginner] Programming Challenge: 1

    Quote Originally Posted by jimi_hendrix View Post
    microsoft visual C++ 2008 is what i used (the only thing they do right is their IDE's)
    I disagree..... Do you know/understand the process of compiling an application, or do you just click the big green button?

Page 16 of 27 FirstFirst ... 6141516171826 ... LastLast

Bookmarks

Posting Permissions

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