• Welcome to the Speedsolving.com, home of the web's largest puzzle community!
    You are currently viewing our forum as a guest which gives you limited access to join discussions and access our other features.

    Registration is fast, simple and absolutely free so please, join our community of 40,000+ people from around the world today!

    If you are already a member, simply login to hide this message and begin participating in the community!

Java Programming

byu

Member
Joined
Dec 18, 2008
Messages
2,021
Location
California
WCA
2009YUBR01
YouTube
Visit Channel
So, I took a course in java this week, it ends today. I'm trying to think of an interesting text-based Java game that I could write, but I'm not sure exactly what. Can any of you give me some suggestions? Thanks.
 

byu

Member
Joined
Dec 18, 2008
Messages
2,021
Location
California
WCA
2009YUBR01
YouTube
Visit Channel
mhmm...Java.

Obviously, a choose-your-own-adventure story, cubing-based, of course.


That would be funny:


You see a 5 move cross or an 8 move X-Cross, which do you do?

All edges are oriented on the LL. If you apply the OLL case, you will get a T-Permutation. If you use COLL, you will get a U-Permutation. Which do you do?

And yes, we covered classes, methodization, constructors, subclassing, String class and its methods, Math class and its methods, and a few other things.
 

Poke

Member
Joined
Mar 14, 2009
Messages
197
Location
Pound, Virginia
YouTube
Visit Channel
Any php classes around where you live... And free plane tickets, and free hotel, and free food, etc. (I know php is a weak language, but I can't afford asp)
 

joey

Member
Joined
Apr 8, 2007
Messages
4,413
WCA
2007GOUL01
YouTube
Visit Channel
LOL asp :{

Try writing Conways Game of Life. That was fun when I was just learning.

Code:
$><<"\e[2J";s,o,f,c,u=20,"#"," ";b,m=(z=0..s).map{z.map{(rand<0.3)?o:f
}},[-1,0,1]*3;until c==b;c=b.map{|z|z.dup};$><<"\e[H"<<b.map{|x|x*f}*"
";s.times{|i|s.times{|e|n=(m.sort.zip(m)-[[0,0]]).select{|x,z|o==(c[i+
x]||[])[e+z]}.size;n!=2?b[i][e]=n==3?o:f:f}};sleep 0.2;end

Some code I wrote to do Game of Life, with a bit of help from the ruby-talk mailing list.
 
Last edited:

MichaelErskine

Premium Member
Joined
Jul 9, 2008
Messages
1,244
Location
Sherwood, Nottingham, UK
WCA
2008ERSK01
YouTube
Visit Channel
$><<"\e[2J";s,o,f,c,u=20,"#"," ";b,m=(z=0..s).map{z.map{(rand<0.3)?o:f
}},[-1,0,1]*3;until c==b;c=b.map{|z|z.dup};$><<"\e[H"<<b.map{|x|x*f}*"
";s.times{|i|s.times{|e|n=(m.sort.zip(m)-[[0,0]]).select{|x,z|o==(c[i+
x]||[])[e+z]}.size;n!=2?b[e]=n==3?o:f:f}};sleep 0.2;end


Impressive Joey - I dig the Ruby but Perl wins out over at code golf: http://codegolf.com/conways-game-of-life
 

MatsBergsten

Premium Member
Joined
Jul 11, 2008
Messages
2,686
Location
Bergshamra, Sweden
WCA
2008BERG04
So, I took a course in java this week, it ends today. I'm trying to think of an interesting text-based Java game that I could write, but I'm not sure exactly what. Can any of you give me some suggestions? Thanks.

A test program for BH-corners and/or edges. That can easily be textbased. The program chooses two random cubies and you shall give the correspondent BH-alg.

I intend to write one myself (but not in Java).
 
Top