Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
Programming Stories
Closed Thread
 
LinkBack Thread Tools Display Modes
  #1  
Old 11-14-2009, 10:06 PM
Y0u_G0t_Pwn3d's Avatar
Guru
 
Join Date: Feb 2007
Posts: 1,486
Default 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-
__________________


^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
The Greatest Gf Any Guy Could Ask For.

Quote:
Originally Posted by benwise90 View Post
Thanks, You G0t Pwn3d, very nice guy, offered to get me a free subscription. Didn't work, but the intent counts <3. Vouch

Last edited by Y0u_G0t_Pwn3d : 11-14-2009 at 10:07 PM.
  #2  
Old 11-16-2009, 03:19 AM
Jimmy's Avatar
Leecher
Ex-Moderator $5 USD Donor
 
Join Date: Jun 2008
Location: Southern California
Posts: 2,359
Default Re: Programming Stories

Quote:
Originally Posted by Y0u_G0t_Pwn3d View Post
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-
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.
__________________
  #3  
Old 12-21-2009, 09:27 AM
Newcomer
 
Join Date: Nov 2009
Posts: 8
Default Re: Programming Stories

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

_____________
Wonderbra
  #4  
Old 04-05-2010, 08:59 AM
Active Member
 
Join Date: Feb 2010
Posts: 135
Default Re: Programming Stories

took c++ in highschool, dropped out, never loooked back.
  #5  
Old 04-17-2010, 05:10 PM
Member
 
Join Date: Dec 2008
Posts: 91
Default Re: Programming Stories

Quote:
Originally Posted by Jimmy5410 View Post
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.
rofl i would say age explains your ineptitude but then again at your age i was better
  #6  
Old 04-17-2010, 05:22 PM
Forum Addict
 
Join Date: Feb 2007
Posts: 306
Default Re: 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
  #7  
Old 05-01-2010, 08:02 AM
b0b3rt's Avatar
Apprentice
$5 USD Donor
 
Join Date: Aug 2008
Posts: 974
Default Re: 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
__________________


<3 Sam <3 Nate <3 Jake <3 Austin </3 Justin
  #8  
Old 05-02-2010, 02:09 AM
Jimmy's Avatar
Leecher
Ex-Moderator $5 USD Donor
 
Join Date: Jun 2008
Location: Southern California
Posts: 2,359
Default Re: Programming Stories

Quote:
Originally Posted by b0b3rt View Post
Jimmy.. I understand that was probably fairly fast and rough, but your random method sucks =P
Yeah, that code is absolutely disgusting.

This thread is quite old, too D:
__________________
Closed Thread



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 07:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1