little games

P

Puppet_Sock

Hi my name is Carlos Obregón and I'm currently a profesor of C/C++
programming at the CUMD in Bogotá Colombia.

This last term I ask my students to develop an implementation of the
minesweeper game with ASCII graphics and input via keyboard.

I'm trying to look for other games suitable to those restrictions.

Does anyone knows a good candidate?

Thanks a lot.

Think about making some larger games, and have each student
do part of the project. Something like Zork or one of those.
A text-based adventure game. Might make an interesting proj
for three or four students. Could get them going on project
management, working in a coding group, etc.

Then there's the whole Eliza thing. Have not heard much about
such progs lately, though got to admit I have not been looking.
Socks
 
U

user923005

Hi my name is Carlos Obregón and I'm currently a profesor of C/C++
programming at the CUMD in Bogotá Colombia.

This last term I ask my students to develop an implementation of the
minesweeper game with ASCII graphics and input via keyboard.

I'm trying to look for other games suitable to those restrictions.

Does anyone knows a good candidate?
From easy to hard:

Tic-tac-toe (naughts and crosses for those across the pond)
Connect-4
Othello
Fanorona
Checkers (Draughts)
Mancala
Chess
Go

Need more ideas?
http://en.wikipedia.org/wiki/Category:Abstract_strategy_games
 
A

Anthony Irwin

Nathan said:
Pong? Breakout? Tetris? Asteriods? Lunar Lander? Basically, look at
games from the late 70s/early 80s, and tell your students to make one.

Hi All,

To do something that requires clearing the screen and redrawing it
wouldn't you need to use a third-party library like ncurses or can you
still do it using just standard C?

Kind Regards,
Anthony Irwin
 
S

sergejusz

Hi my name is Carlos Obregón and I'm currently a profesor of C/C++
programming at the CUMD in Bogotá Colombia.

This last term I ask my students to develop an implementation of the
minesweeper game with ASCII graphics and input via keyboard.

I'm trying to look for other games suitable to those restrictions.

Does anyone knows a good candidate?

Thanks a lot.

Hi,
I remember game, maybe called 'Snake' ... You control snake using
arrow keys, the goal is to eat all asterisks '*' randomly appearing on
the board (25x80). when snake eats the '*' it becomes longer.
experienced players managed to control huge snakes filling almost all
cells of board. Snake dies when it collides with board walls or
itself.

Serge
http://www.sergejusz.com
 
U

user923005

Nathan said:
Hi All,

To do something that requires clearing the screen and redrawing it
wouldn't you need to use a third-party library like ncurses or can you
still do it using just standard C?

Kind Regards,
Anthony Irwin

It's a FAQ:
19.4: How can I clear the screen?
How can I print text in color?
How can I move the cursor to a specific x, y position?

A: Such things depend on the terminal type (or display) you're
using. You will have to use a library such as termcap,
terminfo, or curses, or some system-specific routines, to
perform these operations. On MS-DOS systems, two functions
to look for are clrscr() and gotoxy().

For clearing the screen, a halfway portable solution is to print
a form-feed character ('\f'), which will cause some displays to
clear. Even more portable (albeit even more gunky) might be to
print enough newlines to scroll everything away. As a last
resort, you could use system() (see question 19.27) to invoke
an operating system clear-screen command.

References: PCS Sec. 5.1.4 pp. 54-60, Sec. 5.1.5 pp. 60-62.

Related FAQs:
19.5: How do I read the arrow keys? What about function keys?

A: Terminfo, some versions of termcap, and some versions of curses
have support for these non-ASCII keys. Typically, a special key
sends a multicharacter sequence (usually beginning with ESC,
'\033'); parsing these can be tricky. (curses will do the
parsing for you, if you call keypad() first.)

Under MS-DOS, if you receive a character with value 0 (*not*
'0'!) while reading the keyboard, it's a flag indicating that
the next character read will be a code indicating a special key.
See any DOS programming guide for lists of keyboard scan codes.
(Very briefly: the up, left, right, and down arrow keys are 72,
75, 77, and 80, and the function keys are 59 through 68.)

References: PCS Sec. 5.1.4 pp. 56-7.

19.6: How do I read the mouse?

A: Consult your system documentation, or ask on an appropriate
system-specific newsgroup (but check its FAQ list first). Mouse
handling is completely different under the X window system, MS-
DOS, the Macintosh, and probably every other system.

References: PCS Sec. 5.5 pp. 78-80.

19.10: How can I do graphics?

A: Once upon a time, Unix had a fairly nice little set of device-
independent plot functions described in plot(3) and plot(5).
The GNU libplot package maintains the same spirit and supports
many modern plot devices;
see http://www.gnu.org/software/plotutils/plotutils.html .

If you're programming for MS-DOS, you'll probably want to use
libraries conforming to the VESA or BGI standards.

If you're trying to talk to a particular plotter, making it draw
is usually a matter of sending it the appropriate escape
sequences; see also question 19.9. The vendor may supply a C-
callable library, or you may be able to find one on the net.

If you're programming for a particular window system (Macintosh,
X windows, Microsoft Windows), you will use its facilities; see
the relevant documentation or newsgroup or FAQ list.

References: PCS Sec. 5.4 pp. 75-77.
 
D

Diego Martins

Hi,
I remember game, maybe called 'Snake' ... You control snake using
arrow keys, the goal is to eat all asterisks '*' randomly appearing on
the board (25x80). when snake eats the '*' it becomes longer.
experienced players managed to control huge snakes filling almost all
cells of board. Snake dies when it collides with board walls or
itself.

Sergehttp://www.sergejusz.com

do you remember the amazing Nibbles game which came with DOS 5.0 ?
It was made in QB (a specialized version of Basic Interpreter) and
exploited well the text mode (emulated 50 lines in the 80x25 text
mode)

very great game! try to find and show it to your students

Diego
 
D

Default User

Richard said:
If you want a true ISO C program, without even the need to assume
ASCII, positionable screens, or pollable keyboards - IOW, something
whose I/O can be written using only <stdio.h> - you could try getting
them to write a text adventure.

The nice thing about those, besides the good range of instructional
topics that come into play, is that it's more entertaining for the
instructor. Instead of X copies of minesweeper with minimal
differences, you'll get a variety of games.




Brian
 
A

Anthony Irwin

do you remember the amazing Nibbles game which came with DOS 5.0 ?
It was made in QB (a specialized version of Basic Interpreter) and
exploited well the text mode (emulated 50 lines in the 80x25 text
mode)

very great game! try to find and show it to your students

Nibbles is available on just about every gnu/linux distro. I play it
on my computer sometimes to kill some time. Very nice snake game but I
only tend to play first few levels.

I did not now that it was originally a dos 5 game though.

Kind Regards,
Anthony Irwin
 
R

Richard Heathfield

Anthony Irwin said:
Nibbles is available on just about every gnu/linux distro. I play it
on my computer sometimes to kill some time. Very nice snake game but I
only tend to play first few levels.

I did not now that it was originally a dos 5 game though.

It wasn't. It had hair on it even then (early 1990s).
 
G

Gaijinco

Thanks to all of you for your kind opinions!

I really didn't wanted them to drill non-standard libraries yet, so
Snake would have to wait. I also think that 2 player games with AI
tend to be no more fun once you code them because you are playing
against someone that thinks as you told it to, so Chess and Go and the
like are also out of the list (for now) Rogue-like games seem very
intresting. It's a big project but it´s doable with a groups of 4
students. Searching the net I also found a game called Paint-by-
Numbers which seems algo very nice, very easy.

Again thanks to all.
 
B

BBM

Hi my name is Carlos Obregón and I'm currently a profesor of C/C++
programming at the CUMD in Bogotá Colombia.

This last term I ask my students to develop an implementation of the
minesweeper game with ASCII graphics and input via keyboard.

I'm trying to look for other games suitable to those restrictions.

Does anyone knows a good candidate?

Thanks a lot.

You've done Minesweeper, a 1-player game. Get them to make a Conway's
Game of Life, a 0-player game
<http://en.wikipedia.org/wiki/Conway's_Game_of_Life>
 
C

CBFalconer

Richard said:
Anthony Irwin said:


It wasn't. It had hair on it even then (early 1990s).

As a result of this thread I found gnibbles on my Ubuntu
installation. Very frustrating. You can't reverse the direction,
only change by 90 degrees. The death of a million cuts.
 
R

Richard Heathfield

CBFalconer said:
As a result of this thread I found gnibbles on my Ubuntu
installation. Very frustrating. You can't reverse the direction,

To do so would mean an immediate collision with your snake's own body.
But you can change by 90 degrees twice in rapid succession. I wouldn't
recommend three times, though. :)
 
M

Miss Elaine Eos

Richard Heathfield said:
BBM said:
And after that, the obvious progression would be to a -1-player game.

Yeah, but games that write, then play themselves is a highly advanced
topic :)

Besides, Life is a multi-player game -- it's all in crowding around the
screen & trying to devise an even cooler start-set :)
 
M

Marcus Kwok

In comp.lang.c++ Richard Heathfield said:
BBM said:


And after that, the obvious progression would be to a -1-player game.

In Soviet Russia, game plays you!
 
P

Peter Shaggy Haywood

Groovy hepcat Gaijinco was jivin' on 19 Mar 2007 10:10:01 -0700 in
comp.lang.c.
little games's a cool scene! Dig it!
This last term I ask my students to develop an implementation of the
minesweeper game with ASCII graphics and input via keyboard.

I'm trying to look for other games suitable to those restrictions.

How about Poker, Blackjack, Go Fish, Gin and other card games? Of
course, making the computer play may be a bit beyond your students'
capabilities. But implementing the games with only human players
shouldn't be too hard.
How about Patience (Solitaire) in its many forms and Memory (player
picks a card from a grid of randomly placed cards, and then guesses
where its pair is in the grid)? How about peg games, for example
Mastermind? How about Battleship?
How about Mosaic? You start with a grid of N by N squares (N >= 3),
each numbered, but with the lower right square empty. Jumble the
squares up within the grid. The player indicates which square to move.
(Note that it must be one adjacent the empty square.) The square
indicated then moves into the empty square, leaving its former
location empty. Thus squares are rearranged until they are all back in
the correct order with the empty square back in the lower right
corner. For example, you start out with something like this (using a
simple 3 * 3 grid):

|---+---+---|
| 1 | 2 | 3 |
|---+---+---|
| 4 | 5 | 6 |
|---+---+---|
| 7 | 8 | |
|---+---+---|

Next, you jumble this up, and present this to the player:

|---+---+---|
| 7 | 3 | 2 |
|---+---+---|
| 6 | 5 | |
|---+---+---|
| 8 | 4 | 1 |
|---+---+---|

Now, suppose the player wants to move square 7. He can't. Only squares
2, 5 and 1 can move, because in this example they're the only ones
adjacent the empty square. So the player chooses square 5, say. Square
5 then moves into the empty square, like so:

|---+---+---|
| 7 | 3 | 2 |
|---+---+---|
| 6 | | 5 |
|---+---+---|
| 8 | 4 | 1 |
|---+---+---|

The player continues to move squares until they are back in their
original (unjumbled) order. At the end of the game you could output
the number of moves made. As an optional rule, the player may be
allowed to "take back" or undo one move.

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
 
M

Martin Golding

Hi my name is Carlos Obregón and I'm currently a profesor of C/C++
programming at the CUMD in Bogotá Colombia.
This last term I ask my students to develop an implementation of the
minesweeper game with ASCII graphics and input via keyboard.
I'm trying to look for other games suitable to those restrictions.
Does anyone knows a good candidate?

Robots is a classic dumb terminal game. I've played a bad star wars/
asteroid type game, but I don't recall the name or the rules.

Martin
 
D

Default User

Peter said:
Groovy hepcat Gaijinco was jivin' on 19 Mar 2007 10:10:01 -0700 in
comp.lang.c.
little games's a cool scene! Dig it!


How about Poker, Blackjack, Go Fish, Gin and other card games? Of
course, making the computer play may be a bit beyond your students'
capabilities. But implementing the games with only human players
shouldn't be too hard.

Actually, Blackjack is a good choice, as the dealer's play is
predetermined by the rules. Make the machine the dealer, so it's pretty
easy to set up a rule-based automaton for it.




Brian
 
D

Diego Martins

Nibbles is available on just about every gnu/linux distro. I play it
on my computer sometimes to kill some time. Very nice snake game but I
only tend to play first few levels.

I did not now that it was originally a dos 5 game though.

Kind Regards,
Anthony Irwin

Nibbles may look like another Tron clone
Therefore it have cool features like doing nice tricks in text mode
(emulating 50 lines in a 25 lines mode).

Good action games in text mode are rare.

Diego
HP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,197
Latest member
ScottChare

Latest Threads

Top