home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume1 / yahtzee / screen.c < prev    next >
C/C++ Source or Header  |  1987-05-08  |  2KB  |  54 lines

  1. #include "types.h"
  2.  
  3. extern Game player[];
  4.  
  5. char *scrn[] = {
  6. /*  0 */  "   Player         |       |       |        |       |",
  7. /*  1 */  "   Aces           |       |       |        |       |",
  8. /*  2 */  "   Twos           |       |       |        |       |",
  9. /*  3 */  "   Threes         |       |       |        |       |",
  10. /*  4 */  "   Fours          |       |       |        |       |",
  11. /*  5 */  "   Fives          |       |       |        |       |",
  12. /*  6 */  "   Sixes          |       |       |        |       |",
  13. /*  7 */  "   Total          |       |       |        |       |",
  14. /*  8 */  "   Bonus for 63   |       |       |        |       |",
  15. /*  9 */  "   ---------------|-------|-------|--------|-------|",
  16. /* 10 */  "   3 of a kind    |       |       |        |       |",
  17. /* 11 */  "   4 of a kind    |       |       |        |       |",
  18. /* 12 */  "   Full house     |       |       |        |       |",
  19. /* 13 */  "   Small straight |       |       |        |       |",
  20. /* 14 */  "   Large straight |       |       |        |       |",
  21. /* 15 */  "   Yahtzee        |       |       |        |       |",
  22. /* 16 */  "   Chance         |       |       |        |       |",
  23. /* 17 */  "   Yahtzee Bonus  |       |       |        |       |",
  24. /* 18 */  "   ---------------|-------|-------|--------|-------|",
  25. /* 19 */  "   Total top      |       |       |        |       |",
  26. /* 20 */  "   Total bottom   |       |       |        |       |",
  27. /* 21 */  "   ---------------|-------|-------|--------|-------|",
  28. /* 22 */  "   Grand Total    |       |       |        |       |",
  29.  
  30. NULL
  31. };
  32.  
  33. drawscreen(n)
  34. int n;
  35. {
  36.     int i;
  37.  
  38.     clear();
  39.     for(i=0; i<10; i++) mvaddstr(i,0,scrn[i]);
  40.     refresh();
  41.     for(i=10; scrn[i]; i++) mvaddstr(i,0,scrn[i]);
  42.     refresh();
  43.     for(i=0; i<n; i++) mvaddstr(0, FC+(i*COLW), player[i].name);
  44.     refresh();
  45. }
  46.  
  47. setname(old,new)
  48. int old,new;
  49. {
  50.     mvaddch(0, FC-1+(old*COLW), ' ');
  51.     mvaddch(0, FC-1+(new*COLW), '*');
  52.     refresh();
  53. }
  54.