Programming Stories

Discussion in 'Programming General' started by Y0u_G0t_Pwn3d, Nov 14, 2009.

Thread Status:
Not open for further replies.
Programming Stories
  1. Unread #1 - Nov 14, 2009 at 5:06 PM
  2. Y0u_G0t_Pwn3d
    Joined:
    Feb 11, 2007
    Posts:
    1,478
    Referrals:
    0
    Sythe Gold:
    0

    Y0u_G0t_Pwn3d Guru

    Programming Stories

    Tell horror stories or brag about success or just rant about languages.

    Ill start with mine:

    I've been programming in Java for about 4 days now, 2 days ago I was doing a programming exercises that came with the free book that I got off the internet. It was to simulate dice rolls and see how many rolls it took to get snake eyes. I set at my laptop for 2 hours trying to figure it out. Then today I went back and I realized I had to use a while loop. -Facepalm-
     
  3. Unread #2 - Nov 15, 2009 at 10:19 PM
  4. Jimmy
    Joined:
    Jun 24, 2008
    Posts:
    2,421
    Referrals:
    10
    Sythe Gold:
    25

    Jimmy Ghost
    Retired Sectional Moderator $5 USD Donor

    Programming Stories

    Code:
    import java.lang.reflect.*;
    
    class DiceTest {
    
        private static int random() {
            return (int)(Math.random() * 6);
        }
    
        public static void main(String[] args) {
            int tries = 0;
            while(true) {
                tries++;
                int dice1 = random();
                int dice2 = random();
                if((dice1 == 1) && (dice2 == 1)) {
                    System.out.println("Snake eyes on try #" + tries);
                    break;
                }
    	}
        }
    
    }
    That took you over 2 hours? Lol..

    Let's see...I got started with HTML when I was in 4th grade because I wanted to make my own website (I have no idea why). In 5th grade, I got a book on game programming which was with blitz basic (a waste of my time, in which I learned nothing). In 6th grade, I got familiar with Java with RSPS (I was so bad, I couldn't create a HelloWorld Program on my own >__<). Then November of last year I started up with Java again. I learned stuff pretty quickly, also learned some C# (very similar to Java), as well as XML (markup, not programming language), php (scripting, not programming), and here I am now.
     
  5. Unread #3 - Dec 21, 2009 at 4:27 AM
  6. ddemetrius456
    Joined:
    Nov 18, 2009
    Posts:
    8
    Referrals:
    0
    Sythe Gold:
    0

    ddemetrius456 Newcomer

    Programming Stories

    Sorry. i have nothing 2 share... But yours one is awesome.

    _____________
    Wonderbra
     
  7. Unread #4 - Apr 5, 2010 at 3:59 AM
  8. greenteashirt
    Joined:
    Feb 12, 2010
    Posts:
    135
    Referrals:
    0
    Sythe Gold:
    0

    greenteashirt Active Member

    Programming Stories

    took c++ in highschool, dropped out, never loooked back.
     
  9. Unread #5 - Apr 17, 2010 at 12:10 PM
  10. super_
    Joined:
    Dec 20, 2008
    Posts:
    91
    Referrals:
    0
    Sythe Gold:
    0

    super_ Member

    Programming Stories

    rofl i would say age explains your ineptitude but then again at your age i was better
     
  11. Unread #6 - Apr 17, 2010 at 12:22 PM
  12. aznguy94
    Joined:
    Feb 11, 2007
    Posts:
    304
    Referrals:
    0
    Sythe Gold:
    0

    aznguy94 Forum Addict

    Programming Stories

    I'm sure if you read the book it would give you a general idea of how to do it...if not, buy a better book. lol
     
  13. Unread #7 - May 1, 2010 at 3:02 AM
  14. b0b3rt
    Joined:
    Aug 3, 2008
    Posts:
    974
    Referrals:
    0
    Sythe Gold:
    0

    b0b3rt Apprentice
    $5 USD Donor

    Programming Stories

    Jimmy.. I understand that was probably fairly fast and rough, but your random method sucks =P

    You shouldn't rely on integer truncation, that's basically like setting each number generated to its floor value instead of actually rounding it. Which means you'll get a disproportionate amount of low numbers XD
     
  15. Unread #8 - May 1, 2010 at 9:09 PM
  16. Jimmy
    Joined:
    Jun 24, 2008
    Posts:
    2,421
    Referrals:
    10
    Sythe Gold:
    25

    Jimmy Ghost
    Retired Sectional Moderator $5 USD Donor

    Programming Stories

    Yeah, that code is absolutely disgusting.

    This thread is quite old, too D:
     
< A request. | Favourite compiler? >

Users viewing this thread
1 guest
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site