home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 12775 < prev    next >
Encoding:
Internet Message Format  |  1992-08-25  |  2.0 KB

  1. Xref: sparky comp.lang.c:12775 comp.lang.c++:12872
  2. Newsgroups: comp.lang.c,comp.lang.c++
  3. Path: sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watdragon.uwaterloo.ca!poppy.uwaterloo.ca!ljcummings
  4. From: ljcummings@poppy.uwaterloo.ca (A Robotic Medievalist)
  5. Subject: C question(s)
  6. Message-ID: <BtK54x.LAE@watdragon.uwaterloo.ca>
  7. Followup-To: ljcummings@poppy.uwaterloo.ca
  8. Originator: ljcummings@poppy.uwaterloo.ca
  9. Sender: news@watdragon.uwaterloo.ca (USENET News System)
  10. Organization: University of Waterloo
  11. Date: Tue, 25 Aug 1992 21:02:57 GMT
  12. Lines: 42
  13.  
  14. I'm in the middle of writing a short 'C' program in BC++ ver 2.0 ...
  15.  
  16. Firstly, let me say that I'm not very good in C ... in fact, I'm pretty
  17. terrible.
  18.  
  19. However, I'm here to ask advice so here goes...
  20.  
  21. What I'm trying to do is write a small flashcard program... nothing
  22. fancy... not necessarily any neat graphics or anything like that.
  23. (will add those later perhaps.)
  24.  
  25. but what I want to do is fairly simple, I want to have a data file which is
  26. organised thus:
  27.  
  28. some words of entry one | some words of entry one-B
  29. some words of entry two and | some words of entry two-B
  30. etc. etc.
  31.  
  32. And to be able to read in either entry one or entry one-B 
  33. (the whole line up to the seperator (|))  display it on the screen,
  34. and wait for a keypress (using getch()) and then display the opposite.
  35.  
  36.     I was thinking the best way to do this was (pardon psuedo-code),
  37.  
  38. while getch(var) != "|"
  39.     putch(var)
  40. getch()
  41. while getch(var) != "\n"
  42. putch(var)
  43. or something like that.
  44.  
  45.     (again just psuedo code) ... however this only does  it in one
  46.     way, not both ways... how could I set it up to (randomly from
  47.     the list) choose entry n, then give it's opposite (or answer..)
  48.     and is there a way to make this then keep track of which ones it
  49.     has randomly chosen, so that it doesn't repeat any until the whole
  50.     file has been processed?
  51.  
  52. ANY help would be apprieciated...
  53.  
  54. I don't read these (note cross-posting) newsgroups,  so *please* reply to:
  55. ljcummings@poppy.uwaterloo.ca
  56.