Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have to come up with a project propsal for my students, here are some details:

  1. The design should be gove over OO concepts: encapsulation, interfaces, inheritance, abstract classes
  2. Idealy a game, to keep interest high
  3. No GUI, just the console
  4. Effective time to finish this: ~ 6 days (1 person per proj)

I have found one nice example of a game with carnivore and herbivore cells in a drop of water (array), it's a game of life twist. It is a bit too simple.

Any ideeas?

Aditional info: - language is C# - no AI and no complex rules

share|improve this question
add comment

9 Answers

You could try battleships. Should allow for some OO concepts and could easily be done on the console.

You could have it a 1 player vs the CPU (and implement different AI algorithms), or do 2 player.

share|improve this answer
    
+1 - One of the easiest games to make on a console. –  Sergio Feb 28 '11 at 12:31
    
Might be a little tight for a 6 day project for students. –  jzd Feb 28 '11 at 13:39
    
@jzd, maybe if you include the AI. However if it's a 2 player game, then it's only a little OO to create the ships, and then array manipulation really to play the game. –  Darren Young Feb 28 '11 at 14:00
    
@Darren, yes I guess the two player would not be that bad. The 6 day time limit is still concerning if these are first year students. –  jzd Feb 28 '11 at 14:07
    
Yes, ~first year students. I do know the battleship game in general, but I don't see a lot of inheritance, interfaces, abstract classes there. Can you clarify? –  Bogdan Gavril Mar 1 '11 at 16:28
show 1 more comment

A simple text adventure.

It's fun, and object orientation is all over the place. You might provide your class with a framework for parsing the input etc, so they can concentrate on designing the actual OO aspects of the game.

share|improve this answer
    
Here is a link to an OO text adventure framework in C# by Jonathan Daggerhart: daggerhart.com/game/c-text-based-adventure-framework –  codecraft Feb 28 '11 at 15:26
3  
Puts me in mind of MUSH programming... Like writing Smalltalk from inside the runtime, in a language designed by Aztecs. Sociopathic Aztecs. –  Jesse Millikan Feb 28 '11 at 17:58
    
@Jesse Millikan With the additional fun of being dumped into "void" if you recompiled the room you were in and it failed. –  biziclop Feb 28 '11 at 20:54
    
Hmm... Never happened to me, but I did occasionally enter my own backpack for fun times (while carrying it). –  Jesse Millikan Feb 28 '11 at 21:10
    
The general ideea is great, but I can't find an actual game (except the one in the first comment, and it's kind of bad :) ) –  Bogdan Gavril Mar 1 '11 at 14:24
add comment

BlackJack with betting on each hand. Console would be relatively simple. Overall project would not be that large in scope.

share|improve this answer
1  
+1 - yes, corrupt those students into gambling! :) –  TZHX Feb 28 '11 at 16:00
1  
I don't see how this is a good example for OO exacly. –  Jesse Millikan Feb 28 '11 at 17:53
add comment

I don't have an answer, but did get inspired by your question and am thinking about creating my own assignment in C#, that's not very interesting off course but I would like to share my first thoughts on how to get there. For inspiration I would use three sources. All of which aren't answers to your question because they aren't in C#, don't have the desired depth or aren't doable in six days. But they might give you some idea's so I thought I would share them anyway.

  • The book "Head first Object-Oriented Anysis & Design" on page 284 starts using a framework for a turn based strategy game
  • an old way of learning OOP is DontFearTheOOP with writing a western novel text here, ppt here
  • internally at my employer we use a simulation of a parking garage, this is nice for thinking about responsibilities of objects and their communication, not so much for inheritance, polymorphism etc. (Googling for "Object Oriented" Parking lot) gives a lot of hits that are similar to our assignment
share|improve this answer
    
Great references, I'm off to check them out. –  Bogdan Gavril Mar 1 '11 at 13:58
add comment

Single player card games work well for learning OOP. Solitaire or 5 Card Draw are good options, and would cover the scope you describe.

If you pick games the students are familiar with and don't add an AI element, you allow the focus to be just on the OOP aspect, not so much on understanding the game rules or developing the best opponent.

share|improve this answer
add comment

In my University the "programming 101" class asks its student to implement a game of poker.

Cards are perfect for abstractions and encapsulation.

Is your double pair, a multiple interface of a single pair? How do you deal with full house?

Heck, how do you shuffle your deck?

share|improve this answer
    
+1 We did this in "intro to programming" as well, learned a lot! –  Ben Feb 28 '11 at 21:50
add comment

In college we created a console version of monopoly to test our OO. Fun & everyone knows it.

share|improve this answer
add comment

This isn't so much a game - As a simulation.

Answer: "Grow a garden"
Its mostly well understood how things grow and what is needed, and allows for each person to be creative in what they do. It can not only teach inheritance, encapsulation, and such, but teach how to do it well such that a way that things can be easily extended and reused.

Start simple and get things working where they can plant seeds, water and watch them grow over time. Then add new things: pick tomatoes, pull carrots ... weeds grow, now pull the weeds, and so on. Keep adding new things over time and they can watch the project literally grow over time.

share|improve this answer
add comment

There's something fundamentally wrong with this question. If you gotta ask, it's not obvious, and if it's not obvious, it can't be simple. You gotta keep it simple.

share|improve this answer
    
I don't think you gotta keep it simple -- simple things usually don't motivate students –  Aivar Nov 30 '11 at 12:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.