home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:12775 comp.lang.c++:12872
- Newsgroups: comp.lang.c,comp.lang.c++
- Path: sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watdragon.uwaterloo.ca!poppy.uwaterloo.ca!ljcummings
- From: ljcummings@poppy.uwaterloo.ca (A Robotic Medievalist)
- Subject: C question(s)
- Message-ID: <BtK54x.LAE@watdragon.uwaterloo.ca>
- Followup-To: ljcummings@poppy.uwaterloo.ca
- Originator: ljcummings@poppy.uwaterloo.ca
- Sender: news@watdragon.uwaterloo.ca (USENET News System)
- Organization: University of Waterloo
- Date: Tue, 25 Aug 1992 21:02:57 GMT
- Lines: 42
-
- I'm in the middle of writing a short 'C' program in BC++ ver 2.0 ...
-
- Firstly, let me say that I'm not very good in C ... in fact, I'm pretty
- terrible.
-
- However, I'm here to ask advice so here goes...
-
- What I'm trying to do is write a small flashcard program... nothing
- fancy... not necessarily any neat graphics or anything like that.
- (will add those later perhaps.)
-
- but what I want to do is fairly simple, I want to have a data file which is
- organised thus:
-
- some words of entry one | some words of entry one-B
- some words of entry two and | some words of entry two-B
- etc. etc.
-
- And to be able to read in either entry one or entry one-B
- (the whole line up to the seperator (|)) display it on the screen,
- and wait for a keypress (using getch()) and then display the opposite.
-
- I was thinking the best way to do this was (pardon psuedo-code),
-
- while getch(var) != "|"
- putch(var)
- getch()
- while getch(var) != "\n"
- putch(var)
- or something like that.
-
- (again just psuedo code) ... however this only does it in one
- way, not both ways... how could I set it up to (randomly from
- the list) choose entry n, then give it's opposite (or answer..)
- and is there a way to make this then keep track of which ones it
- has randomly chosen, so that it doesn't repeat any until the whole
- file has been processed?
-
- ANY help would be apprieciated...
-
- I don't read these (note cross-posting) newsgroups, so *please* reply to:
- ljcummings@poppy.uwaterloo.ca
-