| Tell31's Java adventure! | |
|
+10Tell Tiel+ Iv121 hyperlite Last_Jedi_Standing fr0stbyte124 The Schmetterling Keon Laibach Dux Tell31 14 posters |
|
Author | Message |
---|
Dux Tell31 Recruit
Posts : 379 Join date : 2012-01-05 Location : That is out of the question
| Subject: Tell31's Java adventure! Mon Jul 16, 2012 4:37 pm | |
| Beginning today I'm taking a class that introduces java to teens and gets them started with it. Its been lots of fun and I'll be doing it all week long! I can thank all of you (mostly) for inspiring me to do this. DAY 1What i'v done so far is make a program (using Oracle) that displays the first ten numbers of the fibonacci sequence - Spoiler:
public class FibSequ {
/** * @param args */ public static void main(String[] args) { // Generates the first ten(10) numbers of // the fibonacci sequence, using a "while loop". int num1 = 0; int num2 = 1; int sum = 0; int count = 1; while (count < 11) { sum = num1 + num2; System.out.println(sum); num1 = num2; num2 = sum; count++; // same as "count = count + 1;" }
}
}
Last edited by tell31 on Mon Jul 16, 2012 6:22 pm; edited 1 time in total | |
|
| |
Laibach General
Posts : 2024 Join date : 2012-01-23 Age : 73 Location : Frozen Fields
| Subject: Re: Tell31's Java adventure! Mon Jul 16, 2012 4:41 pm | |
| Have fun! once you do that, try looking at thisIt's how I learned/am learning java, it gets pretty in depth. is it going to get into Object Oriented Programming? although why do you thank us for the Fibonacci sequence? | |
|
| |
Tell Recruit
Posts : 220 Join date : 2012-02-25 Age : 109 Location : Winterhold
| Subject: Re: Tell31's Java adventure! Mon Jul 16, 2012 6:36 pm | |
| I got mine to say Type any number and then it displays that meny numbers of the Fibonacci sequence. Its totaly better (Me and him are in the same class) | |
|
| |
Keon Lord/Lady Rear Admiral 1st
Posts : 3076 Join date : 2012-01-17 Location : Hahahaha.
| Subject: Re: Tell31's Java adventure! Mon Jul 16, 2012 10:59 pm | |
| Cool. Maybe we should all do Ludem Jam. | |
|
| |
The Schmetterling DEV
Posts : 3123 Join date : 2011-08-31 Location : I'm a butterfly.
| Subject: Re: Tell31's Java adventure! Tue Jul 17, 2012 5:11 am | |
| - Keon wrote:
- Cool. Maybe we should all do Ludem Jam.
Is that a joke? | |
|
| |
Keon Lord/Lady Rear Admiral 1st
Posts : 3076 Join date : 2012-01-17 Location : Hahahaha.
| Subject: Re: Tell31's Java adventure! Tue Jul 17, 2012 10:12 am | |
| No. If we all get good at java, we should all make games for our own competition. Maybe not Ludem Dare, but still. | |
|
| |
Tell Recruit
Posts : 220 Join date : 2012-02-25 Age : 109 Location : Winterhold
| Subject: Re: Tell31's Java adventure! Tue Jul 17, 2012 4:34 pm | |
| So right now I just got back from brake at the camp and I just meght some one who joined minecraft at Indev! and we worked on GUI's to day | |
|
| |
Laibach General
Posts : 2024 Join date : 2012-01-23 Age : 73 Location : Frozen Fields
| Subject: Re: Tell31's Java adventure! Tue Jul 17, 2012 9:32 pm | |
| I'm already working on a game of my own Yes, I actually know what I'm going to do and how. - tell wrote:
- I got mine to say Type any number and then it displays that meny numbers of the Fibonacci sequence. Its totaly better (HE(I think?) and I are in the same class)
Congratulations, are you getting/going to get into Object Oriented stuff? | |
|
| |
Dux Tell31 Recruit
Posts : 379 Join date : 2012-01-05 Location : That is out of the question
| Subject: Re: Tell31's Java adventure! Tue Jul 17, 2012 10:11 pm | |
| - tell wrote:
- So right now I just got back from brake at the camp and I just meght some one who joined minecraft at Indev! and we worked on GUI's to day
Um, worng. All we did (at least what I did) was wait for people to finish de-bugging their code, and get COMPLETELY turned around by functions that use exponent in a equation. And now because of said confusion, I hate "For loops". Ya, I had fun. | |
|
| |
fr0stbyte124 Super Developrator
Posts : 1835 Join date : 2011-10-13
| Subject: Re: Tell31's Java adventure! Tue Jul 17, 2012 10:36 pm | |
| But for loops are your greatest ally. | |
|
| |
Keon Lord/Lady Rear Admiral 1st
Posts : 3076 Join date : 2012-01-17 Location : Hahahaha.
| Subject: Re: Tell31's Java adventure! Tue Jul 17, 2012 10:44 pm | |
| - fr0stbyte124 wrote:
- But for loops are your greatest ally.
NAY! While loops are indeed holier than your foul for loops. | |
|
| |
The Schmetterling DEV
Posts : 3123 Join date : 2011-08-31 Location : I'm a butterfly.
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 4:48 am | |
| - Keon wrote:
- fr0stbyte124 wrote:
- But for loops are your greatest ally.
NAY! While loops are indeed holier than your foul for loops. The most superior loop there is could only be the fabled Loop-hole! Yeah! Ownage! | |
|
| |
Laibach General
Posts : 2024 Join date : 2012-01-23 Age : 73 Location : Frozen Fields
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 11:15 am | |
| - Mackeroth? wrote:
- Keon wrote:
- fr0stbyte124 wrote:
- But for loops are your greatest ally.
NAY! While loops are indeed holier than your foul for loops. The most superior loop there is could only be the fabled Loop-hole!
Yeah! Ownage! ...I don't think you know what they're talking about... for is the best loop, for an infinite loops it's just for(;; ) versus while(true) and instead of: int n; while(n < 10){ n++ //code here } you can just put(I think I have the order wrong here): for(int n = 0; n <10; n++){ //code here } | |
|
| |
Tell Recruit
Posts : 220 Join date : 2012-02-25 Age : 109 Location : Winterhold
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 3:00 pm | |
| So today we started working on our final projects for the week (today's Wednesday) and I'm doing a variation of asteroids. So far I have the spaceship done now I'm working on doing the asteroids coming down in a random order then I have to work on the lives and the asteroid exploding as the ship hits it. | |
|
| |
fr0stbyte124 Super Developrator
Posts : 1835 Join date : 2011-10-13
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 4:11 pm | |
| You're writing Asteroids in an intro java course? Does it have graphics, or are you doing it in ascii? | |
|
| |
The Schmetterling DEV
Posts : 3123 Join date : 2011-08-31 Location : I'm a butterfly.
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 5:21 pm | |
| - Dayman wrote:
- Mackeroth? wrote:
- Keon wrote:
- fr0stbyte124 wrote:
- But for loops are your greatest ally.
NAY! While loops are indeed holier than your foul for loops. The most superior loop there is could only be the fabled Loop-hole!
Yeah! Ownage!
...I don't think you know what they're talking about...
for is the best loop, for an infinite loops it's just for(;; ) versus while(true) and instead of:
int n; while(n < 10){ n++ //code here }
you can just put(I think I have the order wrong here):
for(int n = 0; n <10; n++){ //code here } In Python, if I needed an infinite loop I just went: - Code:
-
while 1>0: #code here Why is there no indent button? | |
|
| |
Laibach General
Posts : 2024 Join date : 2012-01-23 Age : 73 Location : Frozen Fields
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 5:47 pm | |
| - Mackeroth? wrote:
- Dayman wrote:
- Mackeroth? wrote:
- Keon wrote:
- fr0stbyte124 wrote:
- But for loops are your greatest ally.
NAY! While loops are indeed holier than your foul for loops. The most superior loop there is could only be the fabled Loop-hole!
Yeah! Ownage!
...I don't think you know what they're talking about...
for is the best loop, for an infinite loops it's just for(;; ) versus while(true) and instead of:
int n; while(n < 10){ n++ //code here }
you can just put(I think I have the order wrong here):
for(int n = 0; n <10; n++){ //code here } In Python, if I needed an infinite loop I just went:
- Code:
-
while 1>0: #code here
Why is there no indent button? That's what I would like to know. and it's (I think) slightly less taxing on the system to put while(true) or for(; instead of 1>0, because the system doesn't have to do as many evaluations or something. although In python I doubt that matters. | |
|
| |
Keon Lord/Lady Rear Admiral 1st
Posts : 3076 Join date : 2012-01-17 Location : Hahahaha.
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 6:04 pm | |
| While is better, for is just a while loop with iterators. While can do so much more.
OH MY GOSH WHILE STOPPED SOUNDING LIKE A WORD. I mean, while. Just say it. While, while, while. | |
|
| |
Tell Recruit
Posts : 220 Join date : 2012-02-25 Age : 109 Location : Winterhold
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 6:54 pm | |
| - fr0stbyte124 wrote:
- You're writing Asteroids in an intro java course? Does it have graphics, or are you doing it in ascii?
Um 1) Yes 2) I'm doing graphics and I'm also using the StdDraw.java class to help me One last thing is that this is a varyation to the Asteroids game. In my verson the astroids come at you and you have to doge them. | |
|
| |
Last_Jedi_Standing Moderator
Posts : 3033 Join date : 2012-02-19 Age : 112 Location : Coruscant
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 7:01 pm | |
| - tell wrote:
- fr0stbyte124 wrote:
- You're writing Asteroids in an intro java course? Does it have graphics, or are you doing it in ascii?
Um
1) Yes
2) I'm doing graphics and I'm also using the StdDraw.java class to help me
One last thing is that this is a varyation to the Asteroids game. In my verson the astroids come at you and you have to doge them. You can't shoot!? | |
|
| |
Dux Tell31 Recruit
Posts : 379 Join date : 2012-01-05 Location : That is out of the question
| |
| |
hyperlite Captain
Posts : 1529 Join date : 2012-01-18
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 7:04 pm | |
| My code: ( : : ( : D D : ^"%:#" SPaceship go pew pew pew #@Kapow!#@$@$ Boom shew shew pew. [Sound] "Were going down" NOpe I haz da loops @$# 1 "froot loops?"#% ##$# End now plzzzzzzzzzzzz | |
|
| |
Dux Tell31 Recruit
Posts : 379 Join date : 2012-01-05 Location : That is out of the question
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 7:07 pm | |
| FROST LOOPS - the most intelligent cereal EVER!!!!? | |
|
| |
hyperlite Captain
Posts : 1529 Join date : 2012-01-18
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 7:09 pm | |
| Make NIM , and make an impossible AI for it and nobody will want to play it with you because it is so simple. | |
|
| |
fr0stbyte124 Super Developrator
Posts : 1835 Join date : 2011-10-13
| Subject: Re: Tell31's Java adventure! Wed Jul 18, 2012 7:31 pm | |
| - Dayman wrote:
- Mackeroth? wrote:
- Dayman wrote:
- Mackeroth? wrote:
- Keon wrote:
- fr0stbyte124 wrote:
- But for loops are your greatest ally.
NAY! While loops are indeed holier than your foul for loops. The most superior loop there is could only be the fabled Loop-hole!
Yeah! Ownage!
...I don't think you know what they're talking about...
for is the best loop, for an infinite loops it's just for(;; ) versus while(true) and instead of:
int n; while(n < 10){ n++ //code here }
you can just put(I think I have the order wrong here):
for(int n = 0; n <10; n++){ //code here } In Python, if I needed an infinite loop I just went:
- Code:
-
while 1>0: #code here
Why is there no indent button? That's what I would like to know.
and it's (I think) slightly less taxing on the system to put while(true) or for(; instead of 1>0, because the system doesn't have to do as many evaluations or something.
although In python I doubt that matters. Most high level languages will do basic optimization on your code, e.g. unrolling loops, tweaking variable scope, and so forth. Pretty much there's not going to be a difference between various ways of saying "repeat forever" or for vs while, so don't stress over it. There is a difference in C++, though. - hyperlite wrote:
- Make NIM , and make an impossible AI for it and nobody will want to play it with you because it is so simple.
Bonus points for using a graph search AI instead of hard coding the strategy. | |
|
| |
Sponsored content
| Subject: Re: Tell31's Java adventure! | |
| |
|
| |
| Tell31's Java adventure! | |
|