473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

little games

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.

Mar 19 '07 #1
45 4479
In article <11**********************@e1g2000hsg.googlegroups. com>,
Gaijinco <ga******@gmail.comwrote:
>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.
Pong? Breakout? Tetris? Asteriods? Lunar Lander? Basically, look at
games from the late 70s/early 80s, and tell your students to make one.

Nathan Mates
--
<*Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
Mar 19 '07 #2
Gaijinco wrote:
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.
Hunt the Wumpus, for that old-skool flavour.
Mar 19 '07 #3
On Mar 19, 10:10 am, "Gaijinco" <gaiji...@gmail.comwrote:
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.
Consider using the Allegro gaming library for your course. The gaming
library code is written in C and can therefore be used in both C and C+
+ courses. Will allow students to develop more interesting/complex
games. The library code is open source, so students can view
internals of functions if they so wish. Deitel Deitel's "C How To
Program" 5th edition has a good introduction in Chapter 15.

Cheers,

Bob L.

Mar 19 '07 #4
To me a good game has a wide range of weapons with strengths and
weaknesses, maybe puzzles as well, just so long as things blow up :)

I'd drop the "graphics" bit, as far as I know it's been a *long* time
since any serious code was written with curses or ascii graphics.
Perhaps go for cleverness of coding, and gameplay, since they're not
anywhere near commercial graphics.

Thus I'd give them something like "adventure" to write. You wander
through some environment and encounter things that you can kill with
the right weapon, or are components of weapons, or enable you to get
to places where you can find weapons.

The interaction is Computer: "You are surrounded by goats"
Player "Kill goats with knife"
Computer : "The goats eat the knife, they thank you for the meal"
Style of fing...
If text parsing is too much work, then accept a grammar of
F1= List Items
F2,1 = Kill with item 1
F3,1 = Drop Item 1
F4 pick up item

I think this is a nice candidate for them to explore object
orientation.
You have a base class
ThingYouCanFind

Derive from it weapon, door key, clue, alien
Different methods, for each class, and of course if you have weapon
broken into components then you can have notions of what C++ class
structure should bring them togther.
Since weapons and alien classes will interact (usually violently) you
allow them to explore class interactions, maybe friends, maybe
pointers to functions.

A depressing % of my life is explaining to CS grads that their skills
are worthless to banks, so am happy that a university actually has a C+
+ professor.
If you have a very very good student with C++, I know some banks that
would like to hire him for sums that he will find wholly accetpable.

Mar 19 '07 #5
In comp.lang.c blangela <Bo***********@telus.netwrote:
Consider using the Allegro gaming library for your course. The gaming
library code is written in C and can therefore be used in both C and C+
+ courses.
Not all C code can or should be used in a C++ course. The following
C program illustrates the point nicely:

#include <stdlib.h>

int main(void) {
char *new = malloc( 10 );
free( new );
return 0;
}

There are at least two features of this program that a C++ compiler
will choke on.

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
Mar 19 '07 #6
In comp.lang.c++ Christopher Benson-Manica <at***@otaku.freeshell.orgwrote:
In comp.lang.c blangela <Bo***********@telus.netwrote:
>Consider using the Allegro gaming library for your course. The gaming
library code is written in C and can therefore be used in both C and C+
+ courses.

Not all C code can or should be used in a C++ course. The following
C program illustrates the point nicely:

#include <stdlib.h>

int main(void) {
char *new = malloc( 10 );
free( new );
return 0;
}

There are at least two features of this program that a C++ compiler
will choke on.
True, but there is also a non-empty set of C programs that will compile
and run just fine when compiled with a C++ compiler. Personally, I know
nothing about the Allegro library, but it may fit in this latter
category (or it may not). However, many compilers also offer the option
to compile both C and C++ code, with switches to control which way the
code is interpreted; linking to the C library may require the use of
extern "C" modifiers though. A large part of C++'s design was to remain
somewhat compatible with existing C code.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Mar 19 '07 #7
Christopher Benson-Manica said:
In comp.lang.c blangela <Bo***********@telus.netwrote:
>Consider using the Allegro gaming library for your course. The
gaming library code is written in C and can therefore be used in both
C and C+ + courses.

Not all C code can or should be used in a C++ course.
Nevertheless, the fact that Allegro has C bindings means that it can be
used as a "black box" library as part of a C++ course. Okay, it's not
exactly strictly conforming portable code, but it exists in (at least)
Win32 and Linux flavours, so there is a reasonable nod towards
cross-platformity.
The following
C program illustrates the point nicely:

#include <stdlib.h>

int main(void) {
char *new = malloc( 10 );
free( new );
return 0;
}

There are at least two features of this program that a C++ compiler
will choke on.
Irrelevant, since nobody is suggesting compiling Allegro with a C++
compiler. What matters is that it has C bindings, so it can be *linked*
into either a C program or a C++ program.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 19 '07 #8

"Nathan Mates" <na****@visi.comwrote in message
In article <11**********************@e1g2000hsg.googlegroups. com>,
Gaijinco <ga******@gmail.comwrote:
>>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.

Pong? Breakout? Tetris? Asteriods? Lunar Lander? Basically, look at
games from the late 70s/early 80s, and tell your students to make one.
Snake is a good one. Two players move snakes about trying to eat dots which
steadily get longer. When you crash you die.

You can write a perfectly acceptable space invaders in ASCII. Try to get
them to give it a twist, such as dead invaders come down in a plume of
asterisks and crash on top of your cities.

Maze programs are always nice. A fill in one in three maze is trivial to
program, a really good maze quite a bit harder.

Puzzles like connect 4, or draughts, or battleships can fairly easily be
programmed. Then there is always the mole game. Mole pops up, and you have
to hit the keypad button before he pops down again. Acceptable in these days
of detachable keyboards but not on a Beeb.

Hangman is a good cop-out for the weaker students.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Mar 19 '07 #9
"Gaijinco" <ga******@gmail.comwrites:
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?
Rogue and its many descendants:

<http://en.wikipedia.org/wiki/Roguelike>

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Mar 19 '07 #10
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?
Rogue-like adventure games easily fall within that definition.
Coincidentially, the 7 day rogue-like challenge is going on and it can
give an idea of the wide range of possibilities within that theme.

http://groups.google.com/group/rec.g...opics?lnk=iggc
--
TAZ

Mar 19 '07 #11
do************@gmail.com wrote:
To me a good game has a wide range of weapons with strengths and
weaknesses, maybe puzzles as well, just so long as things blow up :)

I'd drop the "graphics" bit, as far as I know it's been a long time
since any serious code was written with curses or ascii graphics.
Perhaps go for cleverness of coding, and gameplay, since they're not
anywhere near commercial graphics.

Thus I'd give them something like "adventure" to write. You wander
through some environment and encounter things that you can kill with
the right weapon, or are components of weapons, or enable you to get
to places where you can find weapons.

The interaction is Computer: "You are surrounded by goats"
Player "Kill goats with knife"
Computer : "The goats eat the knife, they thank you for the meal"
Style of fing...
If text parsing is too much work, then accept a grammar of
F1= List Items
F2,1 = Kill with item 1
F3,1 = Drop Item 1
F4 pick up item

To really simplify the grammar and parser for a text-adventure game, go
back to the two-word verb/object system. Each input is a verb followed
by an optional noun.


Brian
Mar 19 '07 #12
In a state of madness zircher wrote the following :
>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?

Rogue-like adventure games easily fall within that definition.
Coincidentially, the 7 day rogue-like challenge is going on and it can
give an idea of the wide range of possibilities within that theme.
Do you truly believe you can ask students on a course to write a
roguelike? :P.
--
At your service,
Kornel Kisielewicz (adminATchaosforge.org) [http://chaosforge.org]
My opinions are my own. Share them at your own risk.
Mar 20 '07 #13
In comp.lang.c Richard Heathfield <rj*@see.sig.invalidwrote:
Irrelevant, since nobody is suggesting compiling Allegro with a C++
compiler.
No one explicitly suggested it, but in the absence of specific
knowledge concerning Allegro it seemed like an assumption in the
realm of possibility. I stand corrected.

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
Mar 20 '07 #14
On Mar 19, 12:10 pm, "Gaijinco" <gaiji...@gmail.comwrote:
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.
Hola, yo ha escrito una juego en la computora. Hice un in perl y orta
se llama pennies and prizes. Ellos estan puesto. Ha ido a Colombia y
me gusta hacer juegos e C++ y antes perl. Por Favor busca aqui:
http://www.planetsourcecode.com/vb/s...t=Alphabetical
http://www.planetsourcecode.com/vb/s...t=Alphabetical

Mar 20 '07 #15
On Mar 19, 12:10 pm, "Gaijinco" <gaiji...@gmail.comwrote:
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.
Aqui es otro que me gusta jugar no se como se hice pero son graphicos
ASCII.

http://www.adom.de/

Mar 20 '07 #16
Christopher Benson-Manica said:
In comp.lang.c Richard Heathfield <rj*@see.sig.invalidwrote:
>Irrelevant, since nobody is suggesting compiling Allegro with a C++
compiler.

No one explicitly suggested it, but in the absence of specific
knowledge concerning Allegro it seemed like an assumption in the
realm of possibility. I stand corrected.
No harm done, Christopher. Was it me that suggested Allegro? I can't now
be bothered to check. If not, may I offer my congratulations to whoever
it was? Excellent idea. BUT don't ever buy an Austin Allegro, unless
you're a scrap metal dealer.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 20 '07 #17
Gaijinco said:
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?
This isn't really a great deal to do with C, but I do get fed up with
all the "you can't do spit in C" nonsense, and encouraging teachers to
teach standard C can't be a bad thing.

So yes, I have a game for you. I don't know what this game is called,
but it's easily doable within your restrictions. If you can play
Minesweeper (specify a location on the grid), you can play this. Here's
the game:

You have a grid, m * n cells in size. Clearly, this grid is composed of
four corner cells each having two neighbour cells, 2(m + n - 2) - 4
edge cells each having three neighbour cells, and (m-2)(n-2) internal
cells, each having four neighbour cells.

Let each cell have three characteristics - an owner, a capacity, and a
population. The owner is one of { None, Human, Computer }, and the
capacity is equal to the number of neighbour cells. We'll deal with
population in a second. The display should be somehow capable of
conveying both the ownership of a cell and its current population,
simultaneously. We'll cover that again in a minute.

All cells start with a population of 1. A cell can never be empty.

Human and computer take turns. Who starts? Up to you.

In each turn, the player simply selects a cell. That's all! It must be
either a cell that the player owns, or a neutral cell. (Equivalently,
it must not be a cell owned by the opposing player.) If a player
selects a neutral cell, he gains ownership of that cell.

The act of selecting a cell adds 1 to its population. If the resulting
population remains within the capacity of the cell, nothing happens.
Otherwise, the cell "explodes", and ALL the units of population that it
is storing (except one) are distributed equally amongst its neighbours,
adding 1 to their populations. This may in turn cause /them/ to
explode, distributing /their/ populations around the cells. Whenever a
cell explodes, the player gains ownership of all its neighbour cells.

Example from top left corner of board:

+-----+-----+-----+-----+-----+--...
| H | C | N | N | N |
| | | | | |
| 2 | 3 | 1 | 1 | 1 |
+-----+-----+-----+-----+-----+--...
| N | C | C | N | N |
| | | | | |
| 1 | 4 | 2 | 1 | 1 |
+-----+-----+-----+-----+-----+--...
| H | H | H | H | C |
| | | | | |
| 2 | 1 | 3 | 1 | 2 |
+-----+-----+-----+-----+-----+--...
| | | | | |

Computer selects the cell one-down one-right from the top left (the
details of the co-ordinate system for cell selection and of course the
way in which you display the grid is entirely up to you).

Since the selected cell has four neighbours, it has a capacity of 4. But
it also has a population of 4. So selecting it causes it to "explode",
with the following result:

+-----+-----+-----+-----+-----+--...
| H | C | N | N | N |
| | | | | |
| 2 | 4 | 1 | 1 | 1 |
+-----+-----+-----+-----+-----+--...
| C | C | C | N | N |
| | | | | |
| 2 | 1 | 3 | 1 | 1 |
+-----+-----+-----+-----+-----+--...
| H | C | H | H | C |
| | | | | |
| 2 | 2 | 3 | 1 | 2 |
+-----+-----+-----+-----+-----+--...
| | | | | |

Note that the computer has gained two cells as a direct result of this
explosion - one that was previously neutral, and one from the human. We
now note that there is a cell on the top row that has a population (4)
exceeding its capacity (3). (The capacity is 3 because the cell has
only three neighbours.) So we must now explode this cell, with the
following result:

+-----+-----+-----+-----+-----+--...
| C | C | C | N | N |
| | | | | |
| 3 | 1 | 2 | 1 | 1 |
+-----+-----+-----+-----+-----+--...
| C | C | C | N | N |
| | | | | |
| 2 | 2 | 3 | 1 | 1 |
+-----+-----+-----+-----+-----+--...
| H | C | H | H | C |
| | | | | |
| 2 | 2 | 3 | 1 | 2 |
+-----+-----+-----+-----+-----+--...
| | | | | |

The computer has gained another couple of cells here. And now the corner
cell exceeds its capacity, so we must explode that too:

+-----+-----+-----+-----+-----+--...
| C | C | C | N | N |
| | | | | |
| 1 | 2 | 2 | 1 | 1 |
+-----+-----+-----+-----+-----+--...
| C | C | C | N | N |
| | | | | |
| 3 | 2 | 3 | 1 | 1 |
+-----+-----+-----+-----+-----+--...
| H | C | H | H | C |
| | | | | |
| 2 | 2 | 3 | 1 | 2 |
+-----+-----+-----+-----+-----+--...
| | | | | |

All quiet again after the excitement, and it's the other player's turn.

Eminently programmable in ISO C. You might want to try to combine the
ownership and population information into a single symbol (e.g. 1234
for human 1234, ABCD for computer 1234, and . for neutral 1), as this
would save you from needing grid lines.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 20 '07 #18
Kornel Kisielewicz wrote:
>
Do you truly believe you can ask students on a course to write a
roguelike? :P.
Sure! Think of all the things a rogue-like goal can teach students.
Displays, user input, file IO, objects, list management, conditional
logic, etc. The low technology requirements means that nearly any
machine can be used for such a class project. When I was teaching
myself how to program back in the day of 8-bit machines, I wrote a
dungeon crawl program so I know it is not an impossible goal. I
didn't even have the benefit of an instructor at the time.
--
TAZ

Mar 20 '07 #19
"Gaijinco" <ga******@gmail.comwrote:
Hi my name is Carlos Obreg=F3n and I'm currently a profesor of C/C++
programming at the CUMD in Bogot=E1 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?
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.

Richard
Mar 20 '07 #20
On Mar 19, 1:10 pm, "Gaijinco" <gaiji...@gmail.comwrote:
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

Mar 20 '07 #21
On Mar 19, 10:10 am, "Gaijinco" <gaiji...@gmail.comwrote:
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/Categor...strategy_games

Mar 20 '07 #22
Nathan Mates wrote:
In article <11**********************@e1g2000hsg.googlegroups. com>,
Gaijinco <ga******@gmail.comwrote:
>>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.


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
Mar 21 '07 #23
On Mar 19, 5:10 pm, "Gaijinco" <gaiji...@gmail.comwrote:
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

Mar 21 '07 #24
On Mar 20, 10:12 pm, Anthony Irwin <nos...@noemailhere.nowherewrote:
Nathan Mates wrote:
In article <1174324201.822468.289...@e1g2000hsg.googlegroups. com>,
Gaijinco <gaiji...@gmail.comwrote:
>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.
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
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.

Mar 21 '07 #25
On Mar 21, 9:10 am, "sergejusz" <sergej...@gmail.comwrote:
On Mar 19, 5:10 pm, "Gaijinco" <gaiji...@gmail.comwrote:
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.

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

Mar 21 '07 #26
Richard Bos wrote:
"Gaijinco" <ga******@gmail.comwrote:
Hi my name is Carlos Obreg=F3n and I'm currently a profesor of C/C++
programming at the CUMD in Bogot=E1 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?

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
Mar 21 '07 #27
>
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
Mar 22 '07 #28
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).

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 22 '07 #29
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.

Mar 22 '07 #30
BBM
On Mar 19, 12:10 pm, "Gaijinco" <gaiji...@gmail.comwrote:
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%27s_Game_of_Life>

Mar 22 '07 #31
BBM said:
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%27s_Game_of_Life>
And after that, the obvious progression would be to a -1-player game.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 22 '07 #32
Richard Heathfield wrote:
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).
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.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Mar 23 '07 #33
CBFalconer said:
Richard Heathfield wrote:
>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).

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. :-)

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 23 '07 #34
In article <pJ*********************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
BBM said:
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%27s_Game_of_Life>
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 :)

--
Please take off your pants or I won't read your e-mail.
I will not, no matter how "good" the deal, patronise any business which sends
unsolicited commercial e-mail or that advertises in discussion newsgroups.
Mar 23 '07 #35
In comp.lang.c++ Richard Heathfield <rj*@see.sig.invalidwrote:
BBM said:
>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%27s_Game_of_Life>

And after that, the obvious progression would be to a -1-player game.
In Soviet Russia, game plays you!

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Mar 23 '07 #36
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"?
Mar 24 '07 #37
On Mon, 19 Mar 2007 10:10:01 -0700, Gaijinco wrote:
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
--
Martin Golding | He who steals my code steals trash.
DoD #0236 | (Twas mine, tis his, and will be slave to thousands.)
y
Mar 24 '07 #38
Peter "Shaggy" Haywood wrote:
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.
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
Mar 24 '07 #39
On Mar 22, 12:27 am, Anthony Irwin <nos...@noemailhere.nowherewrote:
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
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

Mar 26 '07 #40
"Kornel Kisielewicz" <admin@nospam_chaosforge.orgwrote in message
news:et**********@registered.motzarella.org...
In a state of madness zircher wrote the following :
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?
Rogue-like adventure games easily fall within that definition.
Coincidentially, the 7 day rogue-like challenge is going on and it
can
give an idea of the wide range of possibilities within that theme.

Do you truly believe you can ask students on a course to write a
roguelike? :P.
I'm a 16 year old kid who's doing it in my spare time. So, yes, they
should be able to.
Mar 29 '07 #41
On Mar 19, 8:32 pm, "dominic.con...@gmail.com"
<dominic.con...@gmail.comwrote:
To me a good game has a wide range of weapons with strengths and
weaknesses, maybe puzzles as well, just so long as things blow up :)
I'd drop the "graphics" bit, as far as I know it's been a *long* time
since any serious code was written with curses or ascii graphics.
Nethack still uses ascii graphics, and it is still the best
computer game around. (Of course, something like that is
probably a bit too much for a course.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Mar 29 '07 #42
On Mar 19, 12:10 pm, "Gaijinco" <gaiji...@gmail.comwrote:
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?
How could I miss this thread? may be I must read this NG more often :)

I have developing games with ASCII graphics for some time now,
(roguelikes) I think making a simple roguelike would be a pretty good
project for students (although it may not end up as anything fancy,
given how much dedication a roguelike requires).

Also, I am from Medellín, Colombia :) would be nice if there were more
roguelike developers (or at least players) from our country (or even
from south America... I know of nobody else into this)

You can find more info at http://www.santiagoz.com/web and
http://www.roguetemple.com

Thanks and sorry for reviving this thread, almost 2 months later :)
>
Thanks a lot.

May 18 '07 #43
On May 18, 9:12 am, SZDev - Slash <java.ko...@gmail.comwrote:
On Mar 19, 12:10 pm, "Gaijinco" <gaiji...@gmail.comwrote:
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?

How could I miss this thread? may be I must read this NG more often :)

I have developing games with ASCII graphics for some time now,
(roguelikes) I think making a simple roguelike would be a pretty good
project for students (although it may not end up as anything fancy,
given how much dedication a roguelike requires).

Also, I am from Medellín, Colombia :) would be nice if there were more
roguelike developers (or at least players) from our country (or even
from south America... I know of nobody else into this)

You can find more info athttp://www.santiagoz.com/webandhttp://www.roguetemple.com

Thanks and sorry for reviving this thread, almost 2 months later :)


Thanks a lot.- Hide quoted text -

- Show quoted text -
I see that the next release of Deitel & Deitel's "C++ How TO Program"
is coming out this fall. It will have a new chapter dedicated to
gaming. They did a reasonble job when did the same thing in their
newest release of "C How To Program", so I am hoping this new chapter
will be useful in introducing gaming to my C++ students.

Bob

May 18 '07 #44
blangela wrote:
On May 18, 9:12 am, SZDev - Slash <java.ko...@gmail.comwrote:
>On Mar 19, 12:10 pm, "Gaijinco" <gaiji...@gmail.comwrote:
>>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?
How could I miss this thread? may be I must read this NG more often :)

I have developing games with ASCII graphics for some time now,
(roguelikes) I think making a simple roguelike would be a pretty good
project for students (although it may not end up as anything fancy,
given how much dedication a roguelike requires).

Also, I am from Medellín, Colombia :) would be nice if there were more
roguelike developers (or at least players) from our country (or even
from south America... I know of nobody else into this)

You can find more info athttp://www.santiagoz.com/webandhttp://www.roguetemple.com

Thanks and sorry for reviving this thread, almost 2 months later :)


>>Thanks a lot.- Hide quoted text -
- Show quoted text -

I see that the next release of Deitel & Deitel's "C++ How TO Program"
is coming out this fall. It will have a new chapter dedicated to
gaming. They did a reasonble job when did the same thing in their
newest release of "C How To Program", so I am hoping this new chapter
will be useful in introducing gaming to my C++ students.

Bob
may i suggest rec.games.roguelike.development
May 19 '07 #45
blangela wrote:
>
.... snip ...
>
I see that the next release of Deitel & Deitel's "C++ How TO Program"
is coming out this fall. It will have a new chapter dedicated to
gaming. They did a reasonble job when did the same thing in their
newest release of "C How To Program", so I am hoping this new chapter
will be useful in introducing gaming to my C++ students.
This is comp.lang.c. C++ is off-topic here.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

May 22 '07 #46

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

761
by: Neo-LISPer | last post by:
Hey Recently, I researched using C++ for game programming and here is what I found: C++ game developers spend a lot of their time debugging corrupted memory. Few, if any, compilers offer...
10
by: Flare | last post by:
Hi I just read and experimented with normal .net GUI apps and deployed them with notouch deployment strategie as smartclients. Is it just me, or i this an very neglected topic? For me it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.