Im 16 and kinda new to java but i really want to challenge myself. Does anyone have any good ideas for a game i could write or something like that.
All ideas will help!
Printable View
Im 16 and kinda new to java but i really want to challenge myself. Does anyone have any good ideas for a game i could write or something like that.
All ideas will help!
There stereotypical first game to write is a number guessing game where the computer randomly selects a number, and the user guesses which number it is. Also, have it so the computer says "higher" or "lower" based whether your guess is too low or too high respectively.
how hard would that be?
This is one of the first programs I was assigned when took my first programming course. All you need to know to write this program is how to use variables, if statements, and loops.
Why don't you try it out? I (or anybody else here) can help you if you get stuck! The guessing game program is usually the first program I write when learning a new programming language. (After HelloWorld of course!)
LOL!!! I had to do HelloWorld too. It sounds pretty good to try out. What do i need to import? And should i use BufferedReader or JOptionPanes
HelloWorld is very common first program ;-)
I would keep it simple and use a BufferedReader. Otherwise, you shouldn't need to import anything else. Good luck!
Thanks man Ill post if i have problems
What import is the math class?
Oop. I forgot about that. I would use java.util.Random for a random number. Then you can call the nextInt() method instead of dealing with Math.random() returning a double.
The math class is "standard" (no import). If you want a real challenge, look at Project Euler. It's focused on computer algorithms to perform a mathematical task. The math involved is usually very simple but takes an inordinate amount of time to do by hand, and in many cases also by the computer if you use a bad algorithm (ex: add up the number of letters used to spell out all the numbers from 1 to 1000). Unfortunately, this website doesn't get you too much practice with Java, but rather with general computer science and math.
Another good website is Top Coder.com. Again, this is similar to Project Euler, and it is almost entirely focused on algorithms rather than Java.
In my opinion, I think these two websites are much more helpful than actually programming out a massive project (learning wise) because you learn how to solve problems, and we can help you learn the essentials (or you already know them) of how to make the Java compiler happy and do what you want it to do.
Last note: Both websites present extremely difficult problems! While Top Coder.com may have simple solutions to the problems, the answers that score the most points are almost always due to some ingenious implementation of a specific algorithm (I actually haven't scored the top points on any of the problems yet...). Project Euler is more of a website to see if you can get an answer, but I like to try to see if I can make my code as efficient as possible for their problems as well :)
but its still part of the basics.... :) like that one..Quote:
Unfortunately, this website doesn't get you too much practice with Java, but rather with general computer science and math.
as mentioned project euler goes into the math and such, which isn't a bad thing but I think its more for people looking to improve their skill rather than learn basic syntax...for example lots of problems like to deal with the calculation of primes, of course doing these problems can only make you better ;]