Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

toddburch

macrumors 6502a
Original poster
Dec 4, 2006
748
0
Katy, Texas
My son, 17, a Junior in high school, is finishing up his first year of Computer Science. He's been learning Java all year.

He's been assigned a final project to write a simple game. I'm looking for some good ideas to help him get started and motivated.

It needs to be console based - they didn't get into AWT much at all, and certainly nothing with any 2D or 3D graphics.

I wrote a hangman game for somebody else here not too long ago, but that might be a little advanced for his understanding.

Any help with ideas is appreciated. (Motivation is the biggest obstacle..., if you know what I mean with a teenager!)

Todd
 

psingh01

macrumors 68000
Apr 19, 2004
1,586
629
tic-tac-toe? some kind of card game? or a crossword puzzle?

you can have "ascii graphics" on the console/terminal by printing out control commands to the terminal. You'll have to know what those are though (say for a VT100 terminal) and make sure that what you are running on is emulating such a terminal.

That way you can have some kind of screen and not just print out a new line everytime you want input and output. Think of the "top" command how it just refreshes on one screen instead of constantly outputting everything over and over.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Multiple choice trivia is very easy. You can spice it up with point values that decrease with time to respond/incorrect guesses. It could be multiplayer with different keys used to select each choice per player.

Tic-tac-toe is easy. In a college course we programmed tic-tac-toe in Java, but allowed for a computer player. Making it for 2 human players is quite easy. We had to make a computer player that would never lose, so it was a bit more involved. We could also pit two computer players against each other a la WarGames.

A card game for two humans might be decent. Gin or Poker. The machine should be good at "shuffling" the deck, tracking a discard pile, what's in each player's hand, etc. It would be hard to obscure the hands from the other player so he might need to have a key that, when held, would show one player's hand, and another to show the other player's hand, etc. Making a computer player wouldn't be hard as long as there were defined rules. 21 would be the easiest to do with a computer player, and just pick what the behavior is at each value (16 hit, 17 stand, etc.).

While the display might be a little difficult w/ text, connect 4 for human players is pretty easy.

Checkers for human players wouldn't be too bad, but again the display is rough in text. You'd need a "sprite" character for each red checker, each black, and a different character for a "kinged" red or black piece. The rule system shouldn't be too hard to code, though.

I wish I had taken 2 years of programming in high school.

-Lee
 

psingh01

macrumors 68000
Apr 19, 2004
1,586
629
Multiple choice trivia is very easy. You can spice it up with point values that decrease with time to respond/incorrect guesses. It could be multiplayer with different keys used to select each choice per player.

Tic-tac-toe is easy. In a college course we programmed tic-tac-toe in Java, but allowed for a computer player. Making it for 2 human players is quite easy. We had to make a computer player that would never lose, so it was a bit more involved. We could also pit two computer players against each other a la WarGames.

A card game for two humans might be decent. Gin or Poker. The machine should be good at "shuffling" the deck, tracking a discard pile, what's in each player's hand, etc. It would be hard to obscure the hands from the other player so he might need to have a key that, when held, would show one player's hand, and another to show the other player's hand, etc. Making a computer player wouldn't be hard as long as there were defined rules. 21 would be the easiest to do with a computer player, and just pick what the behavior is at each value (16 hit, 17 stand, etc.).

While the display might be a little difficult w/ text, connect 4 for human players is pretty easy.

Checkers for human players wouldn't be too bad, but again the display is rough in text. You'd need a "sprite" character for each red checker, each black, and a different character for a "kinged" red or black piece. The rule system shouldn't be too hard to code, though.

I wish I had taken 2 years of programming in high school.

-Lee

You don't need sprites...just a 'B' for a black checker and a 'R' for a red one and 'BB' and 'RR' for the Kings :) or better yet 'O' and 'X' to differentiate instead of B and R.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
You don't need sprites...just a 'B' for a black checker and a 'R' for a red one and 'BB' and 'RR' for the Kings :) or better yet 'O' and 'X' to differentiate instead of B and R.

That was what I meant, I just said sprite because I wasn't sure what else to call it (indicator? piece-representing character?). Maybe just a lowercase b and r and upper case B and R when they're kinged.

-Lee
 

GoGoPoCoSo

macrumors newbie
May 9, 2008
23
0
Seattle, WA
One of the more memorable games I did in first-year Java class was to create an interactive program that was a re-creation of "The Animal Game", and with a .txt file containing all of the questions and answers from the site (and a few others containing much fewer questions), implement binary trees to get the program working. Helped a lot with understanding recursion. Was fun, console-based, no graphics, first-year program, seems to fit along with your description...

The Animal Game:
http://www.animalgame.com/
 

Pring

macrumors 6502
Sep 17, 2003
310
0
Battleships is fairly easy to lay out and implement and allows him to demonstrate good use of data structures.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
One of the more memorable games I did in first-year Java class was to create an interactive program that was a re-creation of "The Animal Game", and with a .txt file containing all of the questions and answers from the site (and a few others containing much fewer questions), implement binary trees to get the program working. Helped a lot with understanding recursion. Was fun, console-based, no graphics, first-year program, seems to fit along with your description...

The Animal Game:
http://www.animalgame.com/

This isn't related to the OPs question, just a comment that that is awesome. The only things I tried that it didn't get were scorpion and caribou (the latter might have been my fault)... but it was getting all sorts of things. Duck-billed platypus, anteater, sting ray, hyena, human, koala, rhinoceros, emu. Much fun, and a good suggestion for this topic, to boot.

-Lee
 

Catfish_Man

macrumors 68030
Sep 13, 2001
2,579
2
Portland, OR
Very simple RPG. The one I made my first year basically presented a list of options ("go", "quit", etc...), generated random terrains either with or without a monster on them, and if there was a monster you could attack it or run. 1/10 terrains would be a town where you would be healed. After you accumulated N gold from killing monsters, and then reached a forest, you won. The second version had leveling up, buying improved gear, and a few simple spells.

The third version was somewhat ill-fated. I bit off a bit more than I could chew, attempting to have a map with an array of function pointers on each tile that were executed on entering, allowing scripting triggers and such.
 

lazydog

macrumors 6502a
Sep 3, 2005
709
6
Cramlington, UK
Hi Todd,

There were a couple of books published in the late 70', 101 Basic Computer Games. Though the games are all text based, they cover a wide range of topics and I think your son might find inspiration from the list of games, I certainly did many years ago! You can read one of the books online here.

b e n
 

Spritey

macrumors regular
Sep 22, 2006
174
0
Canada/Norway/USA
My son, 17, a Junior in high school, is finishing up his first year of Computer Science. He's been learning Java all year.

He's been assigned a final project to write a simple game. I'm looking for some good ideas to help him get started and motivated.

It needs to be console based - they didn't get into AWT much at all, and certainly nothing with any 2D or 3D graphics.

I wrote a hangman game for somebody else here not too long ago, but that might be a little advanced for his understanding.

Any help with ideas is appreciated. (Motivation is the biggest obstacle..., if you know what I mean with a teenager!)

Todd

I took a year of java as well, and I had to write a lottery "game" for java 1 (pick 7 out of 49 numbers or something, then have the computer randomly draw 7 numbers and see if your chosen numbers win.).

For java 2 I wrote minesweeper, all console based. My board looked something like this.
[ ] [ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ] [ ]

Think I used o and x to indicate mines or open area or something. And you could vary the board size, within reasonable limits of course. I wasn't great at java, and I managed to do it within a reasonable time. I did some research online to point me in the right direction, as it could be a little tricky to come up with the structure at first.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.