Author Topic: What I've done  (Read 7622 times)

1cec0ld

  • Frozen Hearted Admin
  • Professor
  • Fighting Blaine
  • *****
  • Posts: 3084
  • Friendliness: 94
  • Who am I to judge others?
  • Pokemon Team: Typhlosion, Espeon, Aerodactyl, Glalie, Jolteon, Mew the HM Slave
What I've done
« on: May 23, 2012, 03:29:02 am »
My level 5 Charmander:

Code: [Select]
package me.yourname.HelloWorld;


public class HelloWorld  {
public static void main(String[] args){

System.out.println("hi");

}
}

I leveled up!

Code: [Select]
package me.yourname.HelloWorld;


public class HelloWorld  {
public static void main(String[] args){


int number = 4;
if( number < 10 ){
System.out.println("hi");

number++;
}

}
}

Code: [Select]
package me.yourname.HelloWorld;


public class HelloWorld  {
public static void main(String[] args){


int number = 4;
if( number > 10 ){
System.out.println("hi");

number++;
}
else{
System.out.println("hello");
}

}
}

Code: [Select]
package me.yourname.HelloWorld;


public class HelloWorld  {
public static void main(String[] args){


int number = 4;
while( number < 10 ){
System.out.println("hi");

number++;
}

}
}

Idk if I'm evolved or not. Probably level 12 or something.

Ad...

ArchieSalt

  • Professor Assistant
  • Spelunking in Seafoam Islands
  • ****
  • Posts: 2365
  • Friendliness: 25
  • Registered User
Re: What I've done
« Reply #1 on: May 23, 2012, 03:52:47 am »
What da fuq is this?

liquidfired

  • Dragon Tamer
  • Raiding Silph Co.
  • *****
  • Posts: 823
  • Friendliness: -4
  • Unregistered Member (Error 114: Needs Activation)
    • Liquidfired's Channel of Awesomeness
Re: What I've done
« Reply #2 on: May 23, 2012, 04:22:17 am »
epic java work. Keep going, I right now am learning more of Cinemas 4D at the moment. Maybe I could make a Pokemon Server Animation :P

~Ali~

  • Aussie
  • Surfing south to SeaFoam
  • *****
  • Posts: 2068
  • Friendliness: 77
  • Always watching over.
Re: What I've done
« Reply #3 on: May 23, 2012, 04:23:49 am »
Not bad at all. I could give you some tips, if you'd like.

I'm now working on the Unreal Engine, making a game on the iOS.

Memories, something a person will have forever.
ProfileYouTubeRedditPokeCommunityBlog

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: What I've done
« Reply #4 on: May 23, 2012, 05:05:43 pm »
Conditionals and while loops!?!! THIS IS MADNESS!


Also, your second and third snippits of code won't work as I think you would want. I'm a summing your increment the number so it'll actually increment next time, but it won't. You initialize the integer inside the method bodies, so once the method ends and you call it again, number will be 4 again, not 5.

1cec0ld

  • Frozen Hearted Admin
  • Professor
  • Fighting Blaine
  • *****
  • Posts: 3084
  • Friendliness: 94
  • Who am I to judge others?
  • Pokemon Team: Typhlosion, Espeon, Aerodactyl, Glalie, Jolteon, Mew the HM Slave
Re: What I've done
« Reply #5 on: May 23, 2012, 05:53:44 pm »
I ran the code and it printed hi 6 times as I expected? It assumed 6 endLines which surprised me, but I'm not complaining.

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: What I've done
« Reply #6 on: May 23, 2012, 07:27:25 pm »
I ran the code as well and it printed it hi way more than 6 times, which is what I expected. How are you running your code exactly...?

1cec0ld

  • Frozen Hearted Admin
  • Professor
  • Fighting Blaine
  • *****
  • Posts: 3084
  • Friendliness: 94
  • Who am I to judge others?
  • Pokemon Team: Typhlosion, Espeon, Aerodactyl, Glalie, Jolteon, Mew the HM Slave
Re: What I've done
« Reply #7 on: May 23, 2012, 08:22:21 pm »

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: What I've done
« Reply #8 on: May 23, 2012, 08:26:55 pm »
Yeah, that's the while loop one. I said the second and third one. Those didn't work, your while loop looks fine.

Anonymouslyanon

  • Hoenn Head Builder, Official House Auditor
  • Cerulean Leader
  • Cycling Road
  • ***
  • Posts: 1327
  • Friendliness: 24
  • Lather, rinse, maim.
Re: What I've done
« Reply #9 on: May 23, 2012, 08:38:49 pm »
Wait, what is all of this stuff?

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: What I've done
« Reply #10 on: May 23, 2012, 09:42:22 pm »
Those are basic Java programs implementing difference concepts. Mainly conditionals and loops.

1cec0ld

  • Frozen Hearted Admin
  • Professor
  • Fighting Blaine
  • *****
  • Posts: 3084
  • Friendliness: 94
  • Who am I to judge others?
  • Pokemon Team: Typhlosion, Espeon, Aerodactyl, Glalie, Jolteon, Mew the HM Slave
Re: What I've done
« Reply #11 on: May 23, 2012, 09:57:53 pm »
OHHHH I'm a derp.
Yeah that last increment in the if() statement is just me working backwards, I'd already done the while() loop and wanted to show more basic stuff, so i started deleting and then writing the if() stuff. I just forgot to remove the increment line, it literally has no purpose in those sections.

Any ideas on what I should do/practice next? I don't know what I need to learn/brush up on without a direction that leads me to plugin development in the long run.

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: What I've done
« Reply #12 on: May 23, 2012, 10:37:38 pm »
What objects are and how to use them. That's literally it. Once you understand that you can start to develop, most of the methods are already written for us because of the bukkit API. IF you understand objects, we can start to work together and you'll learn mostly from there.


http://docs.oracle.com/javase/tutorial/java/concepts/

1cec0ld

  • Frozen Hearted Admin
  • Professor
  • Fighting Blaine
  • *****
  • Posts: 3084
  • Friendliness: 94
  • Who am I to judge others?
  • Pokemon Team: Typhlosion, Espeon, Aerodactyl, Glalie, Jolteon, Mew the HM Slave
Re: What I've done
« Reply #13 on: May 24, 2012, 12:35:42 am »
This was fun  :haha:

Code: [Select]
package me.yourname.HelloWorld;

//main puts things together into something
public class Assemble  {
public static void main(String[] args){


//2 versions of the thingy
thingy thing1 = new thingy();
thingy thing2 = new thingy();

thing1.printOut();    //instance 1 as default
System.out.println(); //newline

thing1.changeSecondChar( 'w' );
thing1.changeThirdInt( 1 );
thing1.changeFifthInt( 5 );
thing1.changeSixthChar('n');


thing2.printOut();     //instance 2 unchanged
thing1.printAfter();   //instance 1 changed


}
}


class thingy{

int third = 3;
int start = 1;
    char second = 'c';
char sixth = 'l';
int fifth = 0;
char seventh = 'd';

void printOut() {
System.out.print( " " + start + second + third + second + fifth + sixth + seventh );
}
    void printAfter(){
    System.out.print( " " + second + third + sixth + fifth );
   
//This is ticking me off. I have to add the ( " " + blah ) or else
//it defaults to print( int i ); instead of print( string s );
//like a retard, and adds the ascii values up and prints a number.
//Totally stuck here.
   
   
    }


void changeSeventhChar( char newLetter ){

seventh = newLetter;
}
void changeSixthChar( char newLetter ){

sixth = newLetter;
}
void changeSecondChar( char newLetter ){

second = newLetter;
}
void changeStartInt( int newInt ){

start = newInt;
}
void changeThirdInt( int newInt ){

third = newInt;
}
void changeFifthInt( int newInt ){

fifth = newInt;
}
}


However, 2 questions.
1. How do I fix my print( string s ) problem? Each int/char is supposed to append onto the string, but, it defaults to print( int i ) unless i add that space in quotes to the beginning. (Adding it to the end didn't help)

2. Can I optimize my changeDataThing( newData newThing ) methods? Instead of writing a separate method for every single field I declared, can I somehow pass them to a single method for that data type?
« Last Edit: May 24, 2012, 12:45:47 am by 1cec0ld »

1cec0ld

  • Frozen Hearted Admin
  • Professor
  • Fighting Blaine
  • *****
  • Posts: 3084
  • Friendliness: 94
  • Who am I to judge others?
  • Pokemon Team: Typhlosion, Espeon, Aerodactyl, Glalie, Jolteon, Mew the HM Slave
Re: What I've done
« Reply #14 on: May 24, 2012, 12:45:19 am »
whoa freaky stuff if i initialize:

Code: [Select]
thingy thing1 = new thingy();
thingy thing2 = thing1

 :O_o:

I thought it would copy the fields and methods and be separate after that line...