Need game idea for my first year Java student

Discussion in 'Mac Programming' started by toddburch, May 9, 2008.

  1. toddburch macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #1
    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
     
  2. psingh01 macrumors 65816

    Joined:
    Apr 19, 2004
    #2
    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.
     
  3. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #3
    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
     
  4. psingh01 macrumors 65816

    Joined:
    Apr 19, 2004
    #4
    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.
     
  5. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #5
    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
     
  6. GoGoPoCoSo macrumors newbie

    Joined:
    May 9, 2008
    Location:
    Seattle, WA
    #6
    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/
     
  7. Pring macrumors 6502

    Joined:
    Sep 17, 2003
    #8
    Battleships is fairly easy to lay out and implement and allows him to demonstrate good use of data structures.
     
  8. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #9
    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
     
  9. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #10
    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.
     
  10. lazydog macrumors 6502a

    Joined:
    Sep 3, 2005
    Location:
    Cramlington, UK
    #11
    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
     
  11. Spritey macrumors regular

    Spritey

    Joined:
    Sep 22, 2006
    Location:
    Canada/Norway/USA
    #12
    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.
     

Share This Page